diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 2b15debf6e38..5b2b14ad24bf 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -761,6 +761,9 @@ dependencies: '@rush-temp/arm-trafficmanager': specifier: file:./projects/arm-trafficmanager.tgz version: file:projects/arm-trafficmanager.tgz + '@rush-temp/arm-trustedsigning': + specifier: file:./projects/arm-trustedsigning.tgz + version: file:projects/arm-trustedsigning.tgz '@rush-temp/arm-visualstudio': specifier: file:./projects/arm-visualstudio.tgz version: file:projects/arm-visualstudio.tgz @@ -4040,13 +4043,13 @@ packages: resolution: {integrity: sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==} dependencies: '@types/connect': 3.4.38 - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/bunyan@1.8.9: resolution: {integrity: sha512-ZqS9JGpBxVOvsawzmVt30sP++gSQMTejCkIAQ3VdadOcRE8izTyW66hufvwLeH+YEGP6Js2AW7Gz+RMyvrEbmw==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/chai-as-promised@7.1.8: @@ -4062,7 +4065,7 @@ packages: /@types/connect@3.4.38: resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/cookie@0.4.1: @@ -4076,7 +4079,7 @@ packages: /@types/cors@2.8.17: resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/debug@4.1.12: @@ -4115,7 +4118,7 @@ packages: /@types/express-serve-static-core@4.19.5: resolution: {integrity: sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 '@types/qs': 6.9.16 '@types/range-parser': 1.2.7 '@types/send': 0.17.4 @@ -4134,7 +4137,7 @@ packages: resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/http-errors@2.0.4: @@ -4151,7 +4154,7 @@ packages: /@types/is-buffer@2.0.2: resolution: {integrity: sha512-G6OXy83Va+xEo8XgqAJYOuvOMxeey9xM5XKkvwJNmN8rVdcB+r15HvHsG86hl86JvU0y1aa7Z2ERkNFYWw9ySg==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/json-schema@7.0.15: @@ -4161,7 +4164,7 @@ packages: /@types/jsonfile@6.1.4: resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/jsonwebtoken@9.0.6: @@ -4226,13 +4229,13 @@ packages: /@types/mysql@2.15.26: resolution: {integrity: sha512-DSLCOXhkvfS5WNNPbfn2KdICAmk8lLc+/PNvnPnF7gOdMZCxopXduqv0OQ13y/yA/zXTSikZZqVgybUxOEg6YQ==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/node-fetch@2.6.11: resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 form-data: 4.0.0 dev: false @@ -4277,7 +4280,7 @@ packages: /@types/pg@8.6.1: resolution: {integrity: sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 pg-protocol: 1.6.1 pg-types: 2.2.0 dev: false @@ -4304,7 +4307,7 @@ packages: /@types/readdir-glob@1.1.5: resolution: {integrity: sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/resolve@1.20.2: @@ -4323,14 +4326,14 @@ packages: resolution: {integrity: sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==} dependencies: '@types/mime': 1.3.5 - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/serve-static@1.15.7: resolution: {integrity: sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==} dependencies: '@types/http-errors': 2.0.4 - '@types/node': 18.19.50 + '@types/node': 22.5.5 '@types/send': 0.17.4 dev: false @@ -4361,7 +4364,7 @@ packages: /@types/through@0.0.33: resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/tough-cookie@4.0.5: @@ -4395,13 +4398,13 @@ packages: /@types/ws@7.4.7: resolution: {integrity: sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/ws@8.5.12: resolution: {integrity: sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==} dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false /@types/yargs-parser@21.0.3: @@ -4418,7 +4421,7 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 18.19.50 + '@types/node': 22.5.5 dev: false optional: true @@ -6148,7 +6151,7 @@ packages: dependencies: '@types/cookie': 0.4.1 '@types/cors': 2.8.17 - '@types/node': 18.19.50 + '@types/node': 22.5.5 accepts: 1.3.8 base64id: 2.0.0 cookie: 0.4.2 @@ -10756,6 +10759,37 @@ packages: yn: 3.1.1 dev: false + /ts-node@10.9.2(@types/node@18.19.50)(typescript@5.5.4): + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 18.19.50 + acorn: 8.12.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.5.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: false + /ts-node@10.9.2(@types/node@18.19.50)(typescript@5.6.2): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true @@ -12099,7 +12133,7 @@ packages: dev: false file:projects/ai-language-text.tgz: - resolution: {integrity: sha512-Ojho/AT4xqBEUQoGB7ohr4h8M/kg+jzsRc7Y2WCDDLK0Pq9VcDupOBzPJ9K4onGt8/TzureXx1NTJ1HfQaQZTA==, tarball: file:projects/ai-language-text.tgz} + resolution: {integrity: sha512-+28V/u3iH+goVWI66BNbymqVcY+E3RFpiYIDeTU2Yz9PU6RShfvTLT4vZrF0Pp88kJA3Tn6pgX8oHPz/O2o7Ag==, tarball: file:projects/ai-language-text.tgz} name: '@rush-temp/ai-language-text' version: 0.0.0 dependencies: @@ -12272,7 +12306,7 @@ packages: dev: false file:projects/ai-translation-document.tgz: - resolution: {integrity: sha512-IvqPCFiPDfaCTRSw8wwNEbrTMw8646pgulU1RW9pmEKoXLyY8KDkqDR+lv1WmU1lErE4dXgh9aSql86hZDyU5A==, tarball: file:projects/ai-translation-document.tgz} + resolution: {integrity: sha512-GwYwLipQMJO2h0BspCG1Xa9ODSq/e4t5S5eIT/Pxly3RxLu6t4I5Zg1ImBhNHosEaoPCczu18B+5pcrRH97eeg==, tarball: file:projects/ai-translation-document.tgz} name: '@rush-temp/ai-translation-document' version: 0.0.0 dependencies: @@ -12499,7 +12533,7 @@ packages: dev: false file:projects/api-management-custom-widgets-tools.tgz: - resolution: {integrity: sha512-4JW/GwV5qYw3bd3M+S27Sm9QlPy9bTdc2mwnjaCWEpmTGtbTKcwrb8GM+sGT2XlgFui2pvnGNijLaYZ1K7zuIw==, tarball: file:projects/api-management-custom-widgets-tools.tgz} + resolution: {integrity: sha512-kfsbfgWQ9EVaSxZ4FnZIWmd72WV9lJA/cAmAGXi5Q3BO3PJ836j/je5hYbQVWFQgi6MkrOddv6WqLHx63Rufow==, tarball: file:projects/api-management-custom-widgets-tools.tgz} name: '@rush-temp/api-management-custom-widgets-tools' version: 0.0.0 dependencies: @@ -19584,6 +19618,36 @@ packages: - supports-color dev: false + file:projects/arm-trustedsigning.tgz: + resolution: {integrity: sha512-lzaFxwcXAge5C/fewWizERgLp5Zouj+gkT60TUPecAEs3YItwJYp8sjWAAWzXoqlZOu9ijIKJA62fafPNoI+JA==, tarball: file:projects/arm-trustedsigning.tgz} + name: '@rush-temp/arm-trustedsigning' + version: 0.0.0 + dependencies: + '@azure-tools/test-credential': 1.3.1 + '@azure-tools/test-recorder': 3.5.2 + '@azure/core-lro': 2.7.2 + '@azure/identity': 4.4.1 + '@microsoft/api-extractor': 7.47.9(@types/node@18.19.50) + '@types/chai': 4.3.19 + '@types/mocha': 10.0.8 + '@types/node': 18.19.50 + chai: 4.3.10 + cross-env: 7.0.3 + dotenv: 16.4.5 + mkdirp: 3.0.1 + mocha: 10.7.3 + rimraf: 5.0.10 + ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.5.4) + tslib: 2.7.0 + tsx: 4.19.1 + typescript: 5.5.4 + uglify-js: 3.19.3 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + - supports-color + dev: false + file:projects/arm-visualstudio.tgz: resolution: {integrity: sha512-sZqUoPfTZMPABUs78TRxnVgyyvmkfpfdFgnTqDtKV2VMfR1+elQonhWnIB9zZvzM3PWKhHKYMbMYGL6q/6hY0A==, tarball: file:projects/arm-visualstudio.tgz} name: '@rush-temp/arm-visualstudio' @@ -21765,7 +21829,7 @@ packages: dev: false file:projects/eventhubs-checkpointstore-blob.tgz(chai@4.3.10): - resolution: {integrity: sha512-qNqd8gXnG7PRT5F86gpEj0NnT92HHHuXgrEACY/NSzcqieS5NDUBA1yCU8Z/daysMhqBlWSOCsHyJ7l62L7Gqw==, tarball: file:projects/eventhubs-checkpointstore-blob.tgz} + resolution: {integrity: sha512-7+n3JEJoxPOoMfd7xRjC5KB3urMd9hT/IF1dSH5ANGb5+W3xkyGoqneHkfxe+rDXH4uXWKhWmC12ESa0wjGTJA==, tarball: file:projects/eventhubs-checkpointstore-blob.tgz} id: file:projects/eventhubs-checkpointstore-blob.tgz name: '@rush-temp/eventhubs-checkpointstore-blob' version: 0.0.0 @@ -22867,7 +22931,7 @@ packages: dev: false file:projects/microsoft-playwright-testing.tgz: - resolution: {integrity: sha512-ITSzBkmdPixsxudFqxVV8FJiWVl9oSmfRsN5DncpYyAUg/IrzGdyguXq14eqZNwRXdFe2/im/GgtJyQbOXQBhw==, tarball: file:projects/microsoft-playwright-testing.tgz} + resolution: {integrity: sha512-xpirfRdOWn32HnBb78HxKKbplBdg5dagpdT8y9oVXsQTw7/SQhrWosexS173D89jQxMS4jLoWnB+bX/MQMZZxw==, tarball: file:projects/microsoft-playwright-testing.tgz} name: '@rush-temp/microsoft-playwright-testing' version: 0.0.0 dependencies: @@ -23739,7 +23803,7 @@ packages: dev: false file:projects/perf-storage-blob.tgz: - resolution: {integrity: sha512-gZ6zwWp1zoDicXpScCZcMSuaaob3zQrnGCyUUzbkxpVhSN7Rkx05VvAcsf+67Zw6mxZ1aNuEyEcLD8ePMj3WWw==, tarball: file:projects/perf-storage-blob.tgz} + resolution: {integrity: sha512-nrAkSzJAaNZ+eYGwe6dMYDpsidJjHjecyhzGJdQqlopaTkkaDzpappSRV8tnDPPkLlz36d4/R1BZd2s6XlnLkA==, tarball: file:projects/perf-storage-blob.tgz} name: '@rush-temp/perf-storage-blob' version: 0.0.0 dependencies: @@ -23759,7 +23823,7 @@ packages: dev: false file:projects/perf-storage-file-datalake.tgz: - resolution: {integrity: sha512-c+LWtazhGcpP7C2Qey9aZtC+TXE4yACrjv3E3fXZKuOdH+T5+mnXlQdkdaXib1WifaiF2RYO/2pIwBf0Ssnw4w==, tarball: file:projects/perf-storage-file-datalake.tgz} + resolution: {integrity: sha512-GJnE0VYAzRQztLrodmLxTk+SIhETqRl6ENajST3iKebVOi2hJ0ut3VBKdGRP9wIsvGMCUhx8SDg5C7+U6SpenQ==, tarball: file:projects/perf-storage-file-datalake.tgz} name: '@rush-temp/perf-storage-file-datalake' version: 0.0.0 dependencies: @@ -23779,7 +23843,7 @@ packages: dev: false file:projects/perf-storage-file-share.tgz: - resolution: {integrity: sha512-Mx8bjYzBgIU/3qgh4hnZXq46833ydMnmj3WrWT3d7ShivQuOD7bAvwAzIzqLEEw3PyjklNsvGI7bG8VY7izIqg==, tarball: file:projects/perf-storage-file-share.tgz} + resolution: {integrity: sha512-FIhhBfewDIIrp66K92aI+rrtPXiY1Nzh3173OdbWGlEWnAwQ2zxYk5zG7tq3eNjgwnDubkvq+f+Kk4Knk3lKGw==, tarball: file:projects/perf-storage-file-share.tgz} name: '@rush-temp/perf-storage-file-share' version: 0.0.0 dependencies: @@ -24096,7 +24160,7 @@ packages: dev: false file:projects/quantum-jobs.tgz: - resolution: {integrity: sha512-omyiGt/8rwA9rH15hquUguloLfLoZOlnrp+YILRK2ZxBrI9MflWKYtNT1jUqIADycRYH6/ejJWAv8KFZAcnAVQ==, tarball: file:projects/quantum-jobs.tgz} + resolution: {integrity: sha512-EyI5vM1la+ICxSer0h+O6kaHVTU/DBzZqUolZH+hElzKDiXmpxXpqD2P7x/ZZoXFHSKwArFmu5I6kYz/75IY9w==, tarball: file:projects/quantum-jobs.tgz} name: '@rush-temp/quantum-jobs' version: 0.0.0 dependencies: @@ -24395,7 +24459,7 @@ packages: dev: false file:projects/storage-blob-changefeed.tgz: - resolution: {integrity: sha512-p6UaCZ1AapsPwy2MAq0iiC8X7kUxD9O2e/4X7O3XCSuhdE0C4GJ+Hlip2+WVc0djq5Pr/O5qmqu4ISU38ZhEzQ==, tarball: file:projects/storage-blob-changefeed.tgz} + resolution: {integrity: sha512-8KV9di/owQenzoXsfe19xqclM1Axy5wERZTQlkAwUyimkt5rhtX13UVy019YMv4qzvVeJ4h2SnkL2ACl/y/jsA==, tarball: file:projects/storage-blob-changefeed.tgz} name: '@rush-temp/storage-blob-changefeed' version: 0.0.0 dependencies: @@ -24494,7 +24558,7 @@ packages: dev: false file:projects/storage-file-datalake.tgz: - resolution: {integrity: sha512-fCOuNF3hB3Ag/i+e3OCtt15Np9IBCjB1Cc45Dr+CXgAWyW1Q3GNKW4AvH8mHoOvDGfiXLRixKs6XUeAtek9pCA==, tarball: file:projects/storage-file-datalake.tgz} + resolution: {integrity: sha512-FC/2g+ENPQlUMKPrj3Nm2p9penM3sSaIAbZw01qhZUjDQ+tVAlecwqqfQLcAk8qh82sJ9vd4GByEduRHyzh4kA==, tarball: file:projects/storage-file-datalake.tgz} name: '@rush-temp/storage-file-datalake' version: 0.0.0 dependencies: @@ -24545,7 +24609,7 @@ packages: dev: false file:projects/storage-file-share.tgz: - resolution: {integrity: sha512-oOyOXJU2tkLKTgaGqLCbhokZUgwokGA+MNAlyYfsZLXx++gVb75X1rERnSQwK89kcVtajZeZmAf6FB3Od2UWPw==, tarball: file:projects/storage-file-share.tgz} + resolution: {integrity: sha512-GuFyt0d1m2oDh+TuXVpczjUZCwDnEzFgIoq2AHS5ZiB/R5XeCofIDIFQQJQaCuUtY39c6ul4aX5uCP1B8rLN0g==, tarball: file:projects/storage-file-share.tgz} name: '@rush-temp/storage-file-share' version: 0.0.0 dependencies: @@ -24638,7 +24702,7 @@ packages: dev: false file:projects/storage-queue.tgz: - resolution: {integrity: sha512-ybuamJeXjo8gtw06wxoaundel86Z0SQR9gE39BG7RttckZb5h1Z0aLrp84R8O+2a2p31g4ovvZ10gBJV/Z86xg==, tarball: file:projects/storage-queue.tgz} + resolution: {integrity: sha512-IePQwAAuWIRX+Uvxr7M1JRQIhzkotL9NYuw5L8zmuzay7pXXiZUHZed7ghZ56YESovhpwqGm5qwtrYwu4mDl4Q==, tarball: file:projects/storage-queue.tgz} name: '@rush-temp/storage-queue' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index de2153e7fe5f..15acd9a1b1ce 100644 --- a/rush.json +++ b/rush.json @@ -1,7 +1,7 @@ /** * This is the main configuration file for Rush. * For full documentation, please see https://rushjs.io - */ { + */{ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", /** * (Required) This specifies the version of the Rush engine to be used in this repo. @@ -570,7 +570,9 @@ "projectFolder": "common/tools/dev-tool", "versionPolicyName": "utility", // Add Identity to decoupledLocalDependencies so that dev-tool uses the package from npm, avoiding a cyclic dependency. - "decoupledLocalDependencies": ["@azure/identity"] + "decoupledLocalDependencies": [ + "@azure/identity" + ] }, { "packageName": "@azure/eventgrid", @@ -610,7 +612,9 @@ { "packageName": "@azure/identity", "projectFolder": "sdk/identity/identity", - "decoupledLocalDependencies": ["@azure/keyvault-keys"], + "decoupledLocalDependencies": [ + "@azure/keyvault-keys" + ], "versionPolicyName": "client" }, { @@ -2272,6 +2276,11 @@ "packageName": "@azure-rest/batch", "projectFolder": "sdk/batch/batch-rest", "versionPolicyName": "client" + }, + { + "packageName": "@azure/arm-trustedsigning", + "projectFolder": "sdk/trustedsigning/arm-trustedsigning", + "versionPolicyName": "management" } ] -} +} \ No newline at end of file diff --git a/sdk/trustedsigning/arm-trustedsigning/CHANGELOG.md b/sdk/trustedsigning/arm-trustedsigning/CHANGELOG.md new file mode 100644 index 000000000000..52f85862c073 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/CHANGELOG.md @@ -0,0 +1,7 @@ +# Release History + +## 1.0.0-beta.1 (2024-09-23) + +### Features Added + +The package of @azure/arm-trustedsigning is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). diff --git a/sdk/trustedsigning/arm-trustedsigning/LICENSE b/sdk/trustedsigning/arm-trustedsigning/LICENSE new file mode 100644 index 000000000000..7d5934740965 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/sdk/trustedsigning/arm-trustedsigning/README.md b/sdk/trustedsigning/arm-trustedsigning/README.md new file mode 100644 index 000000000000..e2ac1f14cd68 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/README.md @@ -0,0 +1,109 @@ +# Azure CodeSigningManagement client library for JavaScript + +This package contains an isomorphic SDK (runs both in Node.js and in browsers) for Azure CodeSigningManagement client. + +Code Signing resource provider api. + +[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trustedsigning/arm-trustedsigning) | +[Package (NPM)](https://www.npmjs.com/package/@azure/arm-trustedsigning) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-trustedsigning?view=azure-node-preview) | +[Samples](https://github.com/Azure-Samples/azure-samples-js-management) + +## Getting started + +### Currently supported environments + +- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule) +- Latest versions of Safari, Chrome, Edge and Firefox. + +See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details. + +### Prerequisites + +- An [Azure subscription][azure_sub]. + +### Install the `@azure/arm-trustedsigning` package + +Install the Azure CodeSigningManagement client library for JavaScript with `npm`: + +```bash +npm install @azure/arm-trustedsigning +``` + +### Create and authenticate a `CodeSigningManagementClient` + +To create a client object to access the Azure CodeSigningManagement API, you will need the `endpoint` of your Azure CodeSigningManagement resource and a `credential`. The Azure CodeSigningManagement client can use Azure Active Directory credentials to authenticate. +You can find the endpoint for your Azure CodeSigningManagement resource in the [Azure Portal][azure_portal]. + +You can authenticate with Azure Active Directory using a credential from the [@azure/identity][azure_identity] library or [an existing AAD Token](https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token). + +To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the `@azure/identity` package: + +```bash +npm install @azure/identity +``` + +You will also need to **register a new AAD application and grant access to Azure CodeSigningManagement** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. + +For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). + +```javascript +const { CodeSigningManagementClient } = require("@azure/arm-trustedsigning"); +const { DefaultAzureCredential } = require("@azure/identity"); +// For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details. + +const subscriptionId = "00000000-0000-0000-0000-000000000000"; +const client = new CodeSigningManagementClient(new DefaultAzureCredential(), subscriptionId); + +// For client-side applications running in the browser, use this code instead: +// const credential = new InteractiveBrowserCredential({ +// tenantId: "", +// clientId: "" +// }); +// const client = new CodeSigningManagementClient(credential, subscriptionId); +``` + + +### JavaScript Bundle +To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). + +## Key concepts + +### CodeSigningManagementClient + +`CodeSigningManagementClient` is the primary interface for developers using the Azure CodeSigningManagement client library. Explore the methods on this client object to understand the different features of the Azure CodeSigningManagement service that you can access. + +## Troubleshooting + +### Logging + +Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`: + +```javascript +const { setLogLevel } = require("@azure/logger"); +setLogLevel("info"); +``` + +For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger). + +## Next steps + +Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. + +## Contributing + +If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. + +## Related projects + +- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftrustedsigning%2Farm-trustedsigning%2FREADME.png) + +[azure_cli]: https://docs.microsoft.com/cli/azure +[azure_sub]: https://azure.microsoft.com/free/ +[azure_sub]: https://azure.microsoft.com/free/ +[azure_portal]: https://portal.azure.com +[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity +[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential diff --git a/sdk/trustedsigning/arm-trustedsigning/_meta.json b/sdk/trustedsigning/arm-trustedsigning/_meta.json new file mode 100644 index 000000000000..c82a1b848ac8 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/_meta.json @@ -0,0 +1,8 @@ +{ + "commit": "1395effe20072516a13e7a2655ad33d60a478dc8", + "readme": "specification/codesigning/resource-manager/readme.md", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/codesigning/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.14", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/trustedsigning/arm-trustedsigning/api-extractor.json b/sdk/trustedsigning/arm-trustedsigning/api-extractor.json new file mode 100644 index 000000000000..794f530fc4a4 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/api-extractor.json @@ -0,0 +1,31 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + "mainEntryPointFilePath": "./dist-esm/src/index.d.ts", + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, + "dtsRollup": { + "enabled": true, + "untrimmedFilePath": "", + "publicTrimmedFilePath": "./types/arm-trustedsigning.d.ts" + }, + "messages": { + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, + "extractorMessageReporting": { + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } + } + } +} \ No newline at end of file diff --git a/sdk/trustedsigning/arm-trustedsigning/package.json b/sdk/trustedsigning/arm-trustedsigning/package.json new file mode 100644 index 000000000000..110a457f2fd3 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/package.json @@ -0,0 +1,110 @@ +{ + "name": "@azure/arm-trustedsigning", + "sdk-type": "mgmt", + "author": "Microsoft Corporation", + "description": "A generated SDK for CodeSigningManagementClient.", + "version": "1.0.0-beta.1", + "engines": { + "node": ">=18.0.0" + }, + "dependencies": { + "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", + "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", + "tslib": "^2.2.0" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "license": "MIT", + "main": "./dist/index.js", + "module": "./dist-esm/src/index.js", + "types": "./types/arm-trustedsigning.d.ts", + "devDependencies": { + "@microsoft/api-extractor": "^7.31.1", + "mkdirp": "^3.0.1", + "typescript": "~5.5.3", + "uglify-js": "^3.4.9", + "rimraf": "^5.0.0", + "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", + "@azure/identity": "^4.2.1", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", + "chai": "^4.2.0", + "cross-env": "^7.0.2", + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Azure/azure-sdk-for-js.git" + }, + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "files": [ + "dist/**/*.js", + "dist/**/*.js.map", + "dist/**/*.d.ts", + "dist/**/*.d.ts.map", + "dist-esm/**/*.js", + "dist-esm/**/*.js.map", + "dist-esm/**/*.d.ts", + "dist-esm/**/*.d.ts.map", + "src/**/*.ts", + "README.md", + "LICENSE", + "tsconfig.json", + "review/*", + "CHANGELOG.md", + "types/*" + ], + "scripts": { + "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api", + "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", + "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", + "test": "npm run integration-test", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped" + }, + "sideEffects": false, + "//metadata": { + "constantPaths": [ + { + "path": "src/codeSigningManagementClient.ts", + "prefix": "packageDetails" + } + ] + }, + "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/trustedsigning/arm-trustedsigning" +} \ No newline at end of file diff --git a/sdk/trustedsigning/arm-trustedsigning/review/arm-trustedsigning.api.md b/sdk/trustedsigning/arm-trustedsigning/review/arm-trustedsigning.api.md new file mode 100644 index 000000000000..8624d7977468 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/review/arm-trustedsigning.api.md @@ -0,0 +1,490 @@ +## API Report File for "@azure/arm-trustedsigning" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import * as coreAuth from '@azure/core-auth'; +import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; +import { PagedAsyncIterableIterator } from '@azure/core-paging'; +import { SimplePollerLike } from '@azure/core-lro'; + +// @public +export interface AccountSku { + name: SkuName; +} + +// @public +export interface AccountSkuPatch { + name?: SkuName; +} + +// @public +export type ActionType = string; + +// @public +export interface Certificate { + createdDate?: string; + effectiveAt?: Date; + enhancedKeyUsage?: string; + expiryDate?: string; + failureReason?: string; + reason?: string; + remarks?: string; + requestedAt?: Date; + serialNumber?: string; + status?: CertificateStatus; + readonly statusRevocationStatus?: RevocationStatus; + subjectName?: string; + thumbprint?: string; +} + +// @public +export interface CertificateProfile extends ProxyResource { + readonly certificates?: Certificate[]; + identityValidationId?: string; + includeCity?: boolean; + includeCountry?: boolean; + includePostalCode?: boolean; + includeState?: boolean; + includeStreetAddress?: boolean; + profileType?: ProfileType; + readonly provisioningState?: ProvisioningState; + readonly status?: CertificateProfileStatus; +} + +// @public +export interface CertificateProfileListResult { + nextLink?: string; + value: CertificateProfile[]; +} + +// @public +export interface CertificateProfiles { + beginCreate(resourceGroupName: string, accountName: string, profileName: string, resource: CertificateProfile, options?: CertificateProfilesCreateOptionalParams): Promise, CertificateProfilesCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, accountName: string, profileName: string, resource: CertificateProfile, options?: CertificateProfilesCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, profileName: string, options?: CertificateProfilesDeleteOptionalParams): Promise, CertificateProfilesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, profileName: string, options?: CertificateProfilesDeleteOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, profileName: string, options?: CertificateProfilesGetOptionalParams): Promise; + listByCodeSigningAccount(resourceGroupName: string, accountName: string, options?: CertificateProfilesListByCodeSigningAccountOptionalParams): PagedAsyncIterableIterator; + revokeCertificate(resourceGroupName: string, accountName: string, profileName: string, body: RevokeCertificate, options?: CertificateProfilesRevokeCertificateOptionalParams): Promise; +} + +// @public +export interface CertificateProfilesCreateHeaders { + retryAfter?: number; +} + +// @public +export interface CertificateProfilesCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CertificateProfilesCreateResponse = CertificateProfile; + +// @public +export interface CertificateProfilesDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface CertificateProfilesDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CertificateProfilesDeleteResponse = CertificateProfilesDeleteHeaders; + +// @public +export interface CertificateProfilesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificateProfilesGetResponse = CertificateProfile; + +// @public +export interface CertificateProfilesListByCodeSigningAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificateProfilesListByCodeSigningAccountNextResponse = CertificateProfileListResult; + +// @public +export interface CertificateProfilesListByCodeSigningAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificateProfilesListByCodeSigningAccountResponse = CertificateProfileListResult; + +// @public +export interface CertificateProfilesRevokeCertificateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CertificateProfileStatus = string; + +// @public +export type CertificateStatus = string; + +// @public +export interface CheckNameAvailability { + name: string; +} + +// @public +export interface CheckNameAvailabilityResult { + readonly message?: string; + readonly nameAvailable?: boolean; + readonly reason?: NameUnavailabilityReason; +} + +// @public +export interface CodeSigningAccount extends TrackedResource { + readonly accountUri?: string; + readonly provisioningState?: ProvisioningState; + sku?: AccountSku; +} + +// @public +export interface CodeSigningAccountListResult { + nextLink?: string; + value: CodeSigningAccount[]; +} + +// @public +export interface CodeSigningAccountPatch { + sku?: AccountSkuPatch; + tags?: { + [propertyName: string]: string; + }; +} + +// @public +export interface CodeSigningAccounts { + beginCreate(resourceGroupName: string, accountName: string, resource: CodeSigningAccount, options?: CodeSigningAccountsCreateOptionalParams): Promise, CodeSigningAccountsCreateResponse>>; + beginCreateAndWait(resourceGroupName: string, accountName: string, resource: CodeSigningAccount, options?: CodeSigningAccountsCreateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, options?: CodeSigningAccountsDeleteOptionalParams): Promise, CodeSigningAccountsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: CodeSigningAccountsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, properties: CodeSigningAccountPatch, options?: CodeSigningAccountsUpdateOptionalParams): Promise, CodeSigningAccountsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, properties: CodeSigningAccountPatch, options?: CodeSigningAccountsUpdateOptionalParams): Promise; + checkNameAvailability(body: CheckNameAvailability, options?: CodeSigningAccountsCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, options?: CodeSigningAccountsGetOptionalParams): Promise; + listByResourceGroup(resourceGroupName: string, options?: CodeSigningAccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + listBySubscription(options?: CodeSigningAccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface CodeSigningAccountsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CodeSigningAccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResult; + +// @public +export interface CodeSigningAccountsCreateHeaders { + retryAfter?: number; +} + +// @public +export interface CodeSigningAccountsCreateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CodeSigningAccountsCreateResponse = CodeSigningAccount; + +// @public +export interface CodeSigningAccountsDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface CodeSigningAccountsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CodeSigningAccountsDeleteResponse = CodeSigningAccountsDeleteHeaders; + +// @public +export interface CodeSigningAccountsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CodeSigningAccountsGetResponse = CodeSigningAccount; + +// @public +export interface CodeSigningAccountsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CodeSigningAccountsListByResourceGroupNextResponse = CodeSigningAccountListResult; + +// @public +export interface CodeSigningAccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CodeSigningAccountsListByResourceGroupResponse = CodeSigningAccountListResult; + +// @public +export interface CodeSigningAccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CodeSigningAccountsListBySubscriptionNextResponse = CodeSigningAccountListResult; + +// @public +export interface CodeSigningAccountsListBySubscriptionOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type CodeSigningAccountsListBySubscriptionResponse = CodeSigningAccountListResult; + +// @public +export interface CodeSigningAccountsUpdateHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface CodeSigningAccountsUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type CodeSigningAccountsUpdateResponse = CodeSigningAccount; + +// @public (undocumented) +export class CodeSigningManagementClient extends coreClient.ServiceClient { + // (undocumented) + $host: string; + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CodeSigningManagementClientOptionalParams); + // (undocumented) + apiVersion: string; + // (undocumented) + certificateProfiles: CertificateProfiles; + // (undocumented) + codeSigningAccounts: CodeSigningAccounts; + // (undocumented) + operations: Operations; + // (undocumented) + subscriptionId: string; +} + +// @public +export interface CodeSigningManagementClientOptionalParams extends coreClient.ServiceClientOptions { + $host?: string; + apiVersion?: string; + endpoint?: string; +} + +// @public +export type CreatedByType = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: Record; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export function getContinuationToken(page: unknown): string | undefined; + +// @public +export enum KnownActionType { + Internal = "Internal" +} + +// @public +export enum KnownCertificateProfileStatus { + Active = "Active", + Disabled = "Disabled", + Suspended = "Suspended" +} + +// @public +export enum KnownCertificateStatus { + Active = "Active", + Expired = "Expired", + Revoked = "Revoked" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownNameUnavailabilityReason { + AccountNameInvalid = "AccountNameInvalid", + AlreadyExists = "AlreadyExists" +} + +// @public +export enum KnownOrigin { + System = "system", + User = "user", + UserSystem = "user,system" +} + +// @public +export enum KnownProfileType { + PrivateTrust = "PrivateTrust", + PrivateTrustCIPolicy = "PrivateTrustCIPolicy", + PublicTrust = "PublicTrust", + PublicTrustTest = "PublicTrustTest", + VBSEnclave = "VBSEnclave" +} + +// @public +export enum KnownProvisioningState { + Accepted = "Accepted", + Canceled = "Canceled", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownRevocationStatus { + Failed = "Failed", + InProgress = "InProgress", + Succeeded = "Succeeded" +} + +// @public +export enum KnownSkuName { + Basic = "Basic", + Premium = "Premium" +} + +// @public +export type NameUnavailabilityReason = string; + +// @public +export interface Operation { + readonly actionType?: ActionType; + display?: OperationDisplay; + readonly isDataAction?: boolean; + readonly name?: string; + readonly origin?: Origin; +} + +// @public +export interface OperationDisplay { + readonly description?: string; + readonly operation?: string; + readonly provider?: string; + readonly resource?: string; +} + +// @public +export interface OperationListResult { + readonly nextLink?: string; + readonly value?: Operation[]; +} + +// @public +export interface Operations { + list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListNextResponse = OperationListResult; + +// @public +export interface OperationsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type OperationsListResponse = OperationListResult; + +// @public +export type Origin = string; + +// @public +export type ProfileType = string; + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export type RevocationStatus = string; + +// @public +export interface RevokeCertificate { + effectiveAt: Date; + reason: string; + remarks?: string; + serialNumber: string; + thumbprint: string; +} + +// @public +export type SkuName = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: { + [propertyName: string]: string; + }; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/trustedsigning/arm-trustedsigning/sample.env b/sdk/trustedsigning/arm-trustedsigning/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/trustedsigning/arm-trustedsigning/src/codeSigningManagementClient.ts b/sdk/trustedsigning/arm-trustedsigning/src/codeSigningManagementClient.ts new file mode 100644 index 000000000000..61387817bca0 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/codeSigningManagementClient.ts @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; +import * as coreAuth from "@azure/core-auth"; +import { + OperationsImpl, + CodeSigningAccountsImpl, + CertificateProfilesImpl, +} from "./operations"; +import { + Operations, + CodeSigningAccounts, + CertificateProfiles, +} from "./operationsInterfaces"; +import { CodeSigningManagementClientOptionalParams } from "./models"; + +export class CodeSigningManagementClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the CodeSigningManagementClient class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: CodeSigningManagementClientOptionalParams, + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CodeSigningManagementClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials, + }; + + const packageDetails = `azsdk-js-arm-trustedsigning/1.0.0-beta.1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix, + }, + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com", + }; + super(optionsWithDefaults); + + let bearerTokenAuthenticationPolicyFound: boolean = false; + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); + bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName, + ); + } + if ( + !options || + !options.pipeline || + options.pipeline.getOrderedPolicies().length == 0 || + !bearerTokenAuthenticationPolicyFound + ) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + credential: credentials, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge, + }, + }), + ); + } + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2024-09-30-preview"; + this.operations = new OperationsImpl(this); + this.codeSigningAccounts = new CodeSigningAccountsImpl(this); + this.certificateProfiles = new CertificateProfilesImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return "api-version=" + apiVersion; + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + }, + }; + this.pipeline.addPolicy(apiVersionPolicy); + } + + operations: Operations; + codeSigningAccounts: CodeSigningAccounts; + certificateProfiles: CertificateProfiles; +} diff --git a/sdk/trustedsigning/arm-trustedsigning/src/index.ts b/sdk/trustedsigning/arm-trustedsigning/src/index.ts new file mode 100644 index 000000000000..ece18c75a9be --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/index.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +/// +export { getContinuationToken } from "./pagingHelper"; +export * from "./models"; +export { CodeSigningManagementClient } from "./codeSigningManagementClient"; +export * from "./operationsInterfaces"; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/lroImpl.ts b/sdk/trustedsigning/arm-trustedsigning/src/lroImpl.ts new file mode 100644 index 000000000000..5f88efab981b --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/lroImpl.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AbortSignalLike } from "@azure/abort-controller"; +import { LongRunningOperation, LroResponse } from "@azure/core-lro"; + +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal, + }); + }, + }; +} diff --git a/sdk/trustedsigning/arm-trustedsigning/src/models/index.ts b/sdk/trustedsigning/arm-trustedsigning/src/models/index.ts new file mode 100644 index 000000000000..56986de72f62 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/models/index.ts @@ -0,0 +1,743 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +/** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ +export interface OperationListResult { + /** + * List of operations supported by the resource provider + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Operation[]; + /** + * URL to get the next set of operation list results (if there are any). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Details of a REST API operation, returned from the Resource Provider Operations API */ +export interface Operation { + /** + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly isDataAction?: boolean; + /** Localized display information for this particular operation. */ + display?: OperationDisplay; + /** + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly origin?: Origin; + /** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly actionType?: ActionType; +} + +/** Localized display information for this particular operation. */ +export interface OperationDisplay { + /** + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provider?: string; + /** + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly resource?: string; + /** + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly operation?: string; + /** + * The short, localized friendly description of the operation; suitable for tool tips and detailed views. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly description?: string; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +/** The error detail. */ +export interface ErrorDetail { + /** + * The error code. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly code?: string; + /** + * The error message. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; + /** + * The error target. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly target?: string; + /** + * The error details. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly details?: ErrorDetail[]; + /** + * The error additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** + * The additional info type. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * The additional info. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly info?: Record; +} + +/** The parameters used to check the availability of the trusted signing account name. */ +export interface CheckNameAvailability { + /** Trusted signing account name. */ + name: string; +} + +/** The CheckNameAvailability operation response. */ +export interface CheckNameAvailabilityResult { + /** + * A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nameAvailable?: boolean; + /** + * The reason that a trusted signing account name could not be used. The Reason element is only returned if nameAvailable is false. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reason?: NameUnavailabilityReason; + /** + * An error message explaining the Reason value in more detail. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; +} + +/** The response of a CodeSigningAccount list operation. */ +export interface CodeSigningAccountListResult { + /** The CodeSigningAccount items on this page */ + value: CodeSigningAccount[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** SKU of the trusted signing account. */ +export interface AccountSku { + /** Name of the SKU. */ + name: SkuName; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the resource + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +/** Parameters for creating or updating a trusted signing account. */ +export interface CodeSigningAccountPatch { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** SKU of the trusted signing account. */ + sku?: AccountSkuPatch; +} + +/** SKU of the trusted signing account. */ +export interface AccountSkuPatch { + /** Name of the SKU. */ + name?: SkuName; +} + +/** The response of a CertificateProfile list operation. */ +export interface CertificateProfileListResult { + /** The CertificateProfile items on this page */ + value: CertificateProfile[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** Properties of the certificate. */ +export interface Certificate { + /** Serial number of the certificate. */ + serialNumber?: string; + /** Enhanced key usage of the certificate. */ + enhancedKeyUsage?: string; + /** Subject name of the certificate. */ + subjectName?: string; + /** Thumbprint of the certificate. */ + thumbprint?: string; + /** Certificate created date. */ + createdDate?: string; + /** Certificate expiry date. */ + expiryDate?: string; + /** Status of the certificate. */ + status?: CertificateStatus; + /** The timestamp when the revocation is requested. */ + requestedAt?: Date; + /** The timestamp when the revocation is effective. */ + effectiveAt?: Date; + /** Reason for revocation. */ + reason?: string; + /** Remarks for the revocation. */ + remarks?: string; + /** + * Status of the revocation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly statusRevocationStatus?: RevocationStatus; + /** Reason for the revocation failure. */ + failureReason?: string; +} + +/** Defines the certificate revocation properties. */ +export interface RevokeCertificate { + /** Serial number of the certificate. */ + serialNumber: string; + /** Thumbprint of the certificate. */ + thumbprint: string; + /** The timestamp when the revocation is effective. */ + effectiveAt: Date; + /** Reason for the revocation. */ + reason: string; + /** Remarks for the revocation. */ + remarks?: string; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +} + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +/** Trusted signing account resource. */ +export interface CodeSigningAccount extends TrackedResource { + /** + * The URI of the trusted signing account which is used during signing files. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly accountUri?: string; + /** SKU of the trusted signing account. */ + sku?: AccountSku; + /** + * Status of the current operation on trusted signing account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** Certificate profile resource. */ +export interface CertificateProfile extends ProxyResource { + /** Profile type of the certificate. */ + profileType?: ProfileType; + /** Whether to include STREET in the certificate subject name. */ + includeStreetAddress?: boolean; + /** Whether to include L in the certificate subject name. Applicable only for private trust, private trust ci profile types */ + includeCity?: boolean; + /** Whether to include S in the certificate subject name. Applicable only for private trust, private trust ci profile types */ + includeState?: boolean; + /** Whether to include C in the certificate subject name. Applicable only for private trust, private trust ci profile types */ + includeCountry?: boolean; + /** Whether to include PC in the certificate subject name. */ + includePostalCode?: boolean; + /** Identity validation id used for the certificate subject name. */ + identityValidationId?: string; + /** + * Status of the current operation on certificate profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * Status of the certificate profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly status?: CertificateProfileStatus; + /** + * List of renewed certificates. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly certificates?: Certificate[]; +} + +/** Defines headers for CodeSigningAccounts_create operation. */ +export interface CodeSigningAccountsCreateHeaders { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CodeSigningAccounts_update operation. */ +export interface CodeSigningAccountsUpdateHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CodeSigningAccounts_delete operation. */ +export interface CodeSigningAccountsDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CertificateProfiles_create operation. */ +export interface CertificateProfilesCreateHeaders { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for CertificateProfiles_delete operation. */ +export interface CertificateProfilesDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Known values of {@link Origin} that the service accepts. */ +export enum KnownOrigin { + /** User */ + User = "user", + /** System */ + System = "system", + /** UserSystem */ + UserSystem = "user,system", +} + +/** + * Defines values for Origin. \ + * {@link KnownOrigin} can be used interchangeably with Origin, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **user** \ + * **system** \ + * **user,system** + */ +export type Origin = string; + +/** Known values of {@link ActionType} that the service accepts. */ +export enum KnownActionType { + /** Internal */ + Internal = "Internal", +} + +/** + * Defines values for ActionType. \ + * {@link KnownActionType} can be used interchangeably with ActionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Internal** + */ +export type ActionType = string; + +/** Known values of {@link NameUnavailabilityReason} that the service accepts. */ +export enum KnownNameUnavailabilityReason { + /** Account name is invalid */ + AccountNameInvalid = "AccountNameInvalid", + /** Account name already exists */ + AlreadyExists = "AlreadyExists", +} + +/** + * Defines values for NameUnavailabilityReason. \ + * {@link KnownNameUnavailabilityReason} can be used interchangeably with NameUnavailabilityReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **AccountNameInvalid**: Account name is invalid \ + * **AlreadyExists**: Account name already exists + */ +export type NameUnavailabilityReason = string; + +/** Known values of {@link SkuName} that the service accepts. */ +export enum KnownSkuName { + /** Basic sku. */ + Basic = "Basic", + /** Premium sku. */ + Premium = "Premium", +} + +/** + * Defines values for SkuName. \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic**: Basic sku. \ + * **Premium**: Premium sku. + */ +export type SkuName = string; + +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", + /** Updating in progress. */ + Updating = "Updating", + /** Deletion in progress. */ + Deleting = "Deleting", + /** Resource creation started. */ + Accepted = "Accepted", +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Updating**: Updating in progress. \ + * **Deleting**: Deletion in progress. \ + * **Accepted**: Resource creation started. + */ +export type ProvisioningState = string; + +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key", +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + +/** Known values of {@link ProfileType} that the service accepts. */ +export enum KnownProfileType { + /** Used for signing files which are distributed publicly. */ + PublicTrust = "PublicTrust", + /** Used for signing files which are distributed internally within organization or group boundary. */ + PrivateTrust = "PrivateTrust", + /** Used for signing CI policy files. */ + PrivateTrustCIPolicy = "PrivateTrustCIPolicy", + /** Used for signing files which are run in secure vbs enclave. */ + VBSEnclave = "VBSEnclave", + /** Used for signing files for testing purpose. */ + PublicTrustTest = "PublicTrustTest", +} + +/** + * Defines values for ProfileType. \ + * {@link KnownProfileType} can be used interchangeably with ProfileType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PublicTrust**: Used for signing files which are distributed publicly. \ + * **PrivateTrust**: Used for signing files which are distributed internally within organization or group boundary. \ + * **PrivateTrustCIPolicy**: Used for signing CI policy files. \ + * **VBSEnclave**: Used for signing files which are run in secure vbs enclave. \ + * **PublicTrustTest**: Used for signing files for testing purpose. + */ +export type ProfileType = string; + +/** Known values of {@link CertificateProfileStatus} that the service accepts. */ +export enum KnownCertificateProfileStatus { + /** The certificate profile is active. */ + Active = "Active", + /** The certificate profile is disabled. */ + Disabled = "Disabled", + /** The certificate profile is suspended. */ + Suspended = "Suspended", +} + +/** + * Defines values for CertificateProfileStatus. \ + * {@link KnownCertificateProfileStatus} can be used interchangeably with CertificateProfileStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active**: The certificate profile is active. \ + * **Disabled**: The certificate profile is disabled. \ + * **Suspended**: The certificate profile is suspended. + */ +export type CertificateProfileStatus = string; + +/** Known values of {@link CertificateStatus} that the service accepts. */ +export enum KnownCertificateStatus { + /** The certificate is active. */ + Active = "Active", + /** The certificate is expired. */ + Expired = "Expired", + /** The certificate is revoked. */ + Revoked = "Revoked", +} + +/** + * Defines values for CertificateStatus. \ + * {@link KnownCertificateStatus} can be used interchangeably with CertificateStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Active**: The certificate is active. \ + * **Expired**: The certificate is expired. \ + * **Revoked**: The certificate is revoked. + */ +export type CertificateStatus = string; + +/** Known values of {@link RevocationStatus} that the service accepts. */ +export enum KnownRevocationStatus { + /** Certificate revocation succeeded. */ + Succeeded = "Succeeded", + /** Certificate revocation is in progress. */ + InProgress = "InProgress", + /** Certificate revocation failed. */ + Failed = "Failed", +} + +/** + * Defines values for RevocationStatus. \ + * {@link KnownRevocationStatus} can be used interchangeably with RevocationStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Certificate revocation succeeded. \ + * **InProgress**: Certificate revocation is in progress. \ + * **Failed**: Certificate revocation failed. + */ +export type RevocationStatus = string; + +/** Optional parameters. */ +export interface OperationsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type OperationsListResponse = OperationListResult; + +/** Optional parameters. */ +export interface OperationsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type OperationsListNextResponse = OperationListResult; + +/** Optional parameters. */ +export interface CodeSigningAccountsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type CodeSigningAccountsCheckNameAvailabilityResponse = + CheckNameAvailabilityResult; + +/** Optional parameters. */ +export interface CodeSigningAccountsListBySubscriptionOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscription operation. */ +export type CodeSigningAccountsListBySubscriptionResponse = + CodeSigningAccountListResult; + +/** Optional parameters. */ +export interface CodeSigningAccountsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type CodeSigningAccountsListByResourceGroupResponse = + CodeSigningAccountListResult; + +/** Optional parameters. */ +export interface CodeSigningAccountsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CodeSigningAccountsGetResponse = CodeSigningAccount; + +/** Optional parameters. */ +export interface CodeSigningAccountsCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type CodeSigningAccountsCreateResponse = CodeSigningAccount; + +/** Optional parameters. */ +export interface CodeSigningAccountsUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the update operation. */ +export type CodeSigningAccountsUpdateResponse = CodeSigningAccount; + +/** Optional parameters. */ +export interface CodeSigningAccountsDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type CodeSigningAccountsDeleteResponse = + CodeSigningAccountsDeleteHeaders; + +/** Optional parameters. */ +export interface CodeSigningAccountsListBySubscriptionNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listBySubscriptionNext operation. */ +export type CodeSigningAccountsListBySubscriptionNextResponse = + CodeSigningAccountListResult; + +/** Optional parameters. */ +export interface CodeSigningAccountsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type CodeSigningAccountsListByResourceGroupNextResponse = + CodeSigningAccountListResult; + +/** Optional parameters. */ +export interface CertificateProfilesListByCodeSigningAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCodeSigningAccount operation. */ +export type CertificateProfilesListByCodeSigningAccountResponse = + CertificateProfileListResult; + +/** Optional parameters. */ +export interface CertificateProfilesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type CertificateProfilesGetResponse = CertificateProfile; + +/** Optional parameters. */ +export interface CertificateProfilesCreateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the create operation. */ +export type CertificateProfilesCreateResponse = CertificateProfile; + +/** Optional parameters. */ +export interface CertificateProfilesDeleteOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + +/** Contains response data for the delete operation. */ +export type CertificateProfilesDeleteResponse = + CertificateProfilesDeleteHeaders; + +/** Optional parameters. */ +export interface CertificateProfilesRevokeCertificateOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface CertificateProfilesListByCodeSigningAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByCodeSigningAccountNext operation. */ +export type CertificateProfilesListByCodeSigningAccountNextResponse = + CertificateProfileListResult; + +/** Optional parameters. */ +export interface CodeSigningManagementClientOptionalParams + extends coreClient.ServiceClientOptions { + /** server parameter */ + $host?: string; + /** Api Version */ + apiVersion?: string; + /** Overrides client endpoint. */ + endpoint?: string; +} diff --git a/sdk/trustedsigning/arm-trustedsigning/src/models/mappers.ts b/sdk/trustedsigning/arm-trustedsigning/src/models/mappers.ts new file mode 100644 index 000000000000..7c4f41d9015f --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/models/mappers.ts @@ -0,0 +1,826 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; + +export const OperationListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationListResult", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Operation", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Operation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + isDataAction: { + serializedName: "isDataAction", + readOnly: true, + type: { + name: "Boolean", + }, + }, + display: { + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay", + }, + }, + origin: { + serializedName: "origin", + readOnly: true, + type: { + name: "String", + }, + }, + actionType: { + serializedName: "actionType", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const OperationDisplay: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + serializedName: "provider", + readOnly: true, + type: { + name: "String", + }, + }, + resource: { + serializedName: "resource", + readOnly: true, + type: { + name: "String", + }, + }, + operation: { + serializedName: "operation", + readOnly: true, + type: { + name: "String", + }, + }, + description: { + serializedName: "description", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ErrorResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorResponse", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, +}; + +export const ErrorDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorDetail", + modelProperties: { + code: { + serializedName: "code", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + target: { + serializedName: "target", + readOnly: true, + type: { + name: "String", + }, + }, + details: { + serializedName: "details", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetail", + }, + }, + }, + }, + additionalInfo: { + serializedName: "additionalInfo", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, +}; + +export const ErrorAdditionalInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ErrorAdditionalInfo", + modelProperties: { + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + info: { + serializedName: "info", + readOnly: true, + type: { + name: "Dictionary", + value: { type: { name: "any" } }, + }, + }, + }, + }, +}; + +export const CheckNameAvailability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailability", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CheckNameAvailabilityResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResult", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + readOnly: true, + type: { + name: "Boolean", + }, + }, + reason: { + serializedName: "reason", + readOnly: true, + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CodeSigningAccountListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CodeSigningAccountListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CodeSigningAccount", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AccountSku: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountSku", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Resource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Resource", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData", + }, + }, + }, + }, +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String", + }, + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String", + }, + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime", + }, + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String", + }, + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String", + }, + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime", + }, + }, + }, + }, +}; + +export const CodeSigningAccountPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CodeSigningAccountPatch", + modelProperties: { + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "AccountSkuPatch", + }, + }, + }, + }, +}; + +export const AccountSkuPatch: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountSkuPatch", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CertificateProfileListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateProfileListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "CertificateProfile", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const Certificate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Certificate", + modelProperties: { + serialNumber: { + serializedName: "serialNumber", + type: { + name: "String", + }, + }, + enhancedKeyUsage: { + serializedName: "enhancedKeyUsage", + type: { + name: "String", + }, + }, + subjectName: { + serializedName: "subjectName", + type: { + name: "String", + }, + }, + thumbprint: { + serializedName: "thumbprint", + type: { + name: "String", + }, + }, + createdDate: { + serializedName: "createdDate", + type: { + name: "String", + }, + }, + expiryDate: { + serializedName: "expiryDate", + type: { + name: "String", + }, + }, + status: { + serializedName: "status", + type: { + name: "String", + }, + }, + requestedAt: { + serializedName: "revocation.requestedAt", + type: { + name: "DateTime", + }, + }, + effectiveAt: { + serializedName: "revocation.effectiveAt", + type: { + name: "DateTime", + }, + }, + reason: { + serializedName: "revocation.reason", + type: { + name: "String", + }, + }, + remarks: { + serializedName: "revocation.remarks", + type: { + name: "String", + }, + }, + statusRevocationStatus: { + serializedName: "revocation.status", + readOnly: true, + type: { + name: "String", + }, + }, + failureReason: { + serializedName: "revocation.failureReason", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const RevokeCertificate: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RevokeCertificate", + modelProperties: { + serialNumber: { + serializedName: "serialNumber", + required: true, + type: { + name: "String", + }, + }, + thumbprint: { + serializedName: "thumbprint", + required: true, + type: { + name: "String", + }, + }, + effectiveAt: { + serializedName: "effectiveAt", + required: true, + type: { + name: "DateTime", + }, + }, + reason: { + serializedName: "reason", + required: true, + type: { + name: "String", + }, + }, + remarks: { + serializedName: "remarks", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const TrackedResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } }, + }, + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ProxyResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ProxyResource", + modelProperties: { + ...Resource.type.modelProperties, + }, + }, +}; + +export const CodeSigningAccount: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CodeSigningAccount", + modelProperties: { + ...TrackedResource.type.modelProperties, + accountUri: { + serializedName: "properties.accountUri", + readOnly: true, + type: { + name: "String", + }, + }, + sku: { + serializedName: "properties.sku", + type: { + name: "Composite", + className: "AccountSku", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CertificateProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateProfile", + modelProperties: { + ...ProxyResource.type.modelProperties, + profileType: { + serializedName: "properties.profileType", + type: { + name: "String", + }, + }, + includeStreetAddress: { + defaultValue: false, + serializedName: "properties.includeStreetAddress", + type: { + name: "Boolean", + }, + }, + includeCity: { + defaultValue: false, + serializedName: "properties.includeCity", + type: { + name: "Boolean", + }, + }, + includeState: { + defaultValue: false, + serializedName: "properties.includeState", + type: { + name: "Boolean", + }, + }, + includeCountry: { + defaultValue: false, + serializedName: "properties.includeCountry", + type: { + name: "Boolean", + }, + }, + includePostalCode: { + defaultValue: false, + serializedName: "properties.includePostalCode", + type: { + name: "Boolean", + }, + }, + identityValidationId: { + serializedName: "properties.identityValidationId", + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + status: { + serializedName: "properties.status", + readOnly: true, + type: { + name: "String", + }, + }, + certificates: { + serializedName: "properties.certificates", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Certificate", + }, + }, + }, + }, + }, + }, +}; + +export const CodeSigningAccountsCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CodeSigningAccountsCreateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CodeSigningAccountsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CodeSigningAccountsUpdateHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CodeSigningAccountsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CodeSigningAccountsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CertificateProfilesCreateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateProfilesCreateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + +export const CertificateProfilesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CertificateProfilesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/models/parameters.ts b/sdk/trustedsigning/arm-trustedsigning/src/models/parameters.ts new file mode 100644 index 000000000000..92833bcbf592 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/models/parameters.ts @@ -0,0 +1,161 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + OperationParameter, + OperationURLParameter, + OperationQueryParameter, +} from "@azure/core-client"; +import { + CheckNameAvailability as CheckNameAvailabilityMapper, + CodeSigningAccount as CodeSigningAccountMapper, + CodeSigningAccountPatch as CodeSigningAccountPatchMapper, + CertificateProfile as CertificateProfileMapper, + RevokeCertificate as RevokeCertificateMapper, +} from "../models/mappers"; + +export const accept: OperationParameter = { + parameterPath: "accept", + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Accept", + type: { + name: "String", + }, + }, +}; + +export const $host: OperationURLParameter = { + parameterPath: "$host", + mapper: { + serializedName: "$host", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const apiVersion: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2024-09-30-preview", + isConstant: true, + serializedName: "api-version", + type: { + name: "String", + }, + }, +}; + +export const nextLink: OperationURLParameter = { + parameterPath: "nextLink", + mapper: { + serializedName: "nextLink", + required: true, + type: { + name: "String", + }, + }, + skipEncoding: true, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: CheckNameAvailabilityMapper, +}; + +export const subscriptionId: OperationURLParameter = { + parameterPath: "subscriptionId", + mapper: { + serializedName: "subscriptionId", + required: true, + type: { + name: "Uuid", + }, + }, +}; + +export const resourceGroupName: OperationURLParameter = { + parameterPath: "resourceGroupName", + mapper: { + constraints: { + MaxLength: 90, + MinLength: 1, + }, + serializedName: "resourceGroupName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const accountName: OperationURLParameter = { + parameterPath: "accountName", + mapper: { + constraints: { + Pattern: new RegExp("^(?=.{3,24}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$"), + }, + serializedName: "accountName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource: OperationParameter = { + parameterPath: "resource", + mapper: CodeSigningAccountMapper, +}; + +export const properties: OperationParameter = { + parameterPath: "properties", + mapper: CodeSigningAccountPatchMapper, +}; + +export const profileName: OperationURLParameter = { + parameterPath: "profileName", + mapper: { + constraints: { + Pattern: new RegExp( + "^(?=.{5,100}$)[^0-9][A-Za-z0-9]+(?:-[A-Za-z0-9]+)*$", + ), + }, + serializedName: "profileName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource1: OperationParameter = { + parameterPath: "resource", + mapper: CertificateProfileMapper, +}; + +export const body1: OperationParameter = { + parameterPath: "body", + mapper: RevokeCertificateMapper, +}; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operations/certificateProfiles.ts b/sdk/trustedsigning/arm-trustedsigning/src/operations/certificateProfiles.ts new file mode 100644 index 000000000000..8e7da3aee20f --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operations/certificateProfiles.ts @@ -0,0 +1,559 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { CertificateProfiles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { CodeSigningManagementClient } from "../codeSigningManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + CertificateProfile, + CertificateProfilesListByCodeSigningAccountNextOptionalParams, + CertificateProfilesListByCodeSigningAccountOptionalParams, + CertificateProfilesListByCodeSigningAccountResponse, + CertificateProfilesGetOptionalParams, + CertificateProfilesGetResponse, + CertificateProfilesCreateOptionalParams, + CertificateProfilesCreateResponse, + CertificateProfilesDeleteOptionalParams, + CertificateProfilesDeleteResponse, + RevokeCertificate, + CertificateProfilesRevokeCertificateOptionalParams, + CertificateProfilesListByCodeSigningAccountNextResponse, +} from "../models"; + +/// +/** Class containing CertificateProfiles operations. */ +export class CertificateProfilesImpl implements CertificateProfiles { + private readonly client: CodeSigningManagementClient; + + /** + * Initialize a new instance of the class CertificateProfiles class. + * @param client Reference to the service client + */ + constructor(client: CodeSigningManagementClient) { + this.client = client; + } + + /** + * List certificate profiles under a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + public listByCodeSigningAccount( + resourceGroupName: string, + accountName: string, + options?: CertificateProfilesListByCodeSigningAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByCodeSigningAccountPagingAll( + resourceGroupName, + accountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByCodeSigningAccountPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listByCodeSigningAccountPagingPage( + resourceGroupName: string, + accountName: string, + options?: CertificateProfilesListByCodeSigningAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CertificateProfilesListByCodeSigningAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCodeSigningAccount( + resourceGroupName, + accountName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByCodeSigningAccountNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByCodeSigningAccountPagingAll( + resourceGroupName: string, + accountName: string, + options?: CertificateProfilesListByCodeSigningAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByCodeSigningAccountPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * List certificate profiles under a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + private _listByCodeSigningAccount( + resourceGroupName: string, + accountName: string, + options?: CertificateProfilesListByCodeSigningAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByCodeSigningAccountOperationSpec, + ); + } + + /** + * Get details of a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + profileName: string, + options?: CertificateProfilesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, profileName, options }, + getOperationSpec, + ); + } + + /** + * Create a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param resource Parameters to create the certificate profile + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + accountName: string, + profileName: string, + resource: CertificateProfile, + options?: CertificateProfilesCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CertificateProfilesCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, profileName, resource, options }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + CertificateProfilesCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param resource Parameters to create the certificate profile + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + accountName: string, + profileName: string, + resource: CertificateProfile, + options?: CertificateProfilesCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + accountName, + profileName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + profileName: string, + options?: CertificateProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CertificateProfilesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, profileName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + CertificateProfilesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + profileName: string, + options?: CertificateProfilesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + profileName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Revoke a certificate under a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param body Parameters to revoke the certificate profile + * @param options The options parameters. + */ + revokeCertificate( + resourceGroupName: string, + accountName: string, + profileName: string, + body: RevokeCertificate, + options?: CertificateProfilesRevokeCertificateOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, profileName, body, options }, + revokeCertificateOperationSpec, + ); + } + + /** + * ListByCodeSigningAccountNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param nextLink The nextLink from the previous successful call to the ListByCodeSigningAccount + * method. + * @param options The options parameters. + */ + private _listByCodeSigningAccountNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: CertificateProfilesListByCodeSigningAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByCodeSigningAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByCodeSigningAccountOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateProfile, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.profileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CertificateProfile, + }, + 201: { + bodyMapper: Mappers.CertificateProfile, + }, + 202: { + bodyMapper: Mappers.CertificateProfile, + }, + 204: { + bodyMapper: Mappers.CertificateProfile, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.profileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CertificateProfilesDeleteHeaders, + }, + 201: { + headersMapper: Mappers.CertificateProfilesDeleteHeaders, + }, + 202: { + headersMapper: Mappers.CertificateProfilesDeleteHeaders, + }, + 204: { + headersMapper: Mappers.CertificateProfilesDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.profileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const revokeCertificateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}/certificateProfiles/{profileName}/revokeCertificate", + httpMethod: "POST", + responses: { + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.profileName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listByCodeSigningAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CertificateProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operations/codeSigningAccounts.ts b/sdk/trustedsigning/arm-trustedsigning/src/operations/codeSigningAccounts.ts new file mode 100644 index 000000000000..15362ef8051e --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operations/codeSigningAccounts.ts @@ -0,0 +1,764 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { CodeSigningAccounts } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { CodeSigningManagementClient } from "../codeSigningManagementClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + CodeSigningAccount, + CodeSigningAccountsListBySubscriptionNextOptionalParams, + CodeSigningAccountsListBySubscriptionOptionalParams, + CodeSigningAccountsListBySubscriptionResponse, + CodeSigningAccountsListByResourceGroupNextOptionalParams, + CodeSigningAccountsListByResourceGroupOptionalParams, + CodeSigningAccountsListByResourceGroupResponse, + CheckNameAvailability, + CodeSigningAccountsCheckNameAvailabilityOptionalParams, + CodeSigningAccountsCheckNameAvailabilityResponse, + CodeSigningAccountsGetOptionalParams, + CodeSigningAccountsGetResponse, + CodeSigningAccountsCreateOptionalParams, + CodeSigningAccountsCreateResponse, + CodeSigningAccountPatch, + CodeSigningAccountsUpdateOptionalParams, + CodeSigningAccountsUpdateResponse, + CodeSigningAccountsDeleteOptionalParams, + CodeSigningAccountsDeleteResponse, + CodeSigningAccountsListBySubscriptionNextResponse, + CodeSigningAccountsListByResourceGroupNextResponse, +} from "../models"; + +/// +/** Class containing CodeSigningAccounts operations. */ +export class CodeSigningAccountsImpl implements CodeSigningAccounts { + private readonly client: CodeSigningManagementClient; + + /** + * Initialize a new instance of the class CodeSigningAccounts class. + * @param client Reference to the service client + */ + constructor(client: CodeSigningManagementClient) { + this.client = client; + } + + /** + * Lists trusted signing accounts within a subscription. + * @param options The options parameters. + */ + public listBySubscription( + options?: CodeSigningAccountsListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listBySubscriptionPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); + }, + }; + } + + private async *listBySubscriptionPagingPage( + options?: CodeSigningAccountsListBySubscriptionOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CodeSigningAccountsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listBySubscriptionNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listBySubscriptionPagingAll( + options?: CodeSigningAccountsListBySubscriptionOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listBySubscriptionPagingPage(options)) { + yield* page; + } + } + + /** + * Lists trusted signing accounts within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: CodeSigningAccountsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings, + ); + }, + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: CodeSigningAccountsListByResourceGroupOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: CodeSigningAccountsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: CodeSigningAccountsListByResourceGroupOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options, + )) { + yield* page; + } + } + + /** + * Checks that the trusted signing account name is valid and is not already in use. + * @param body The CheckAvailability request + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailability, + options?: CodeSigningAccountsCheckNameAvailabilityOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { body, options }, + checkNameAvailabilityOperationSpec, + ); + } + + /** + * Lists trusted signing accounts within a subscription. + * @param options The options parameters. + */ + private _listBySubscription( + options?: CodeSigningAccountsListBySubscriptionOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { options }, + listBySubscriptionOperationSpec, + ); + } + + /** + * Lists trusted signing accounts within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: CodeSigningAccountsListByResourceGroupOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec, + ); + } + + /** + * Get a trusted Signing Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: CodeSigningAccountsGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + getOperationSpec, + ); + } + + /** + * Create a trusted Signing Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param resource Parameters to create the trusted signing account + * @param options The options parameters. + */ + async beginCreate( + resourceGroupName: string, + accountName: string, + resource: CodeSigningAccount, + options?: CodeSigningAccountsCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CodeSigningAccountsCreateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, resource, options }, + spec: createOperationSpec, + }); + const poller = await createHttpPoller< + CodeSigningAccountsCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a trusted Signing Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param resource Parameters to create the trusted signing account + * @param options The options parameters. + */ + async beginCreateAndWait( + resourceGroupName: string, + accountName: string, + resource: CodeSigningAccount, + options?: CodeSigningAccountsCreateOptionalParams, + ): Promise { + const poller = await this.beginCreate( + resourceGroupName, + accountName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Update a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param properties Parameters supplied to update the trusted signing account + * @param options The options parameters. + */ + async beginUpdate( + resourceGroupName: string, + accountName: string, + properties: CodeSigningAccountPatch, + options?: CodeSigningAccountsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CodeSigningAccountsUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, properties, options }, + spec: updateOperationSpec, + }); + const poller = await createHttpPoller< + CodeSigningAccountsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Update a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param properties Parameters supplied to update the trusted signing account + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + properties: CodeSigningAccountPatch, + options?: CodeSigningAccountsUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + properties, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + accountName: string, + options?: CodeSigningAccountsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CodeSigningAccountsDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ) => { + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown, + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback, + }, + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON(), + }, + }; + }; + + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, accountName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + CodeSigningAccountsDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: CodeSigningAccountsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * ListBySubscriptionNext + * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. + * @param options The options parameters. + */ + private _listBySubscriptionNext( + nextLink: string, + options?: CodeSigningAccountsListBySubscriptionNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listBySubscriptionNextOperationSpec, + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: CodeSigningAccountsListByResourceGroupNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const listBySubscriptionOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.CodeSigning/codeSigningAccounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CodeSigningAccountListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CodeSigningAccountListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CodeSigningAccount, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.CodeSigningAccount, + }, + 201: { + bodyMapper: Mappers.CodeSigningAccount, + }, + 202: { + bodyMapper: Mappers.CodeSigningAccount, + }, + 204: { + bodyMapper: Mappers.CodeSigningAccount, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const updateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.CodeSigningAccount, + }, + 201: { + bodyMapper: Mappers.CodeSigningAccount, + }, + 202: { + bodyMapper: Mappers.CodeSigningAccount, + }, + 204: { + bodyMapper: Mappers.CodeSigningAccount, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.properties, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CodeSigning/codeSigningAccounts/{accountName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.CodeSigningAccountsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.CodeSigningAccountsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.CodeSigningAccountsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.CodeSigningAccountsDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CodeSigningAccountListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.CodeSigningAccountListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operations/index.ts b/sdk/trustedsigning/arm-trustedsigning/src/operations/index.ts new file mode 100644 index 000000000000..42c7309720f0 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operations/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./codeSigningAccounts"; +export * from "./certificateProfiles"; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operations/operations.ts b/sdk/trustedsigning/arm-trustedsigning/src/operations/operations.ts new file mode 100644 index 000000000000..6fd01bef1ad0 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operations/operations.ts @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Operations } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { CodeSigningManagementClient } from "../codeSigningManagementClient"; +import { + Operation, + OperationsListNextOptionalParams, + OperationsListOptionalParams, + OperationsListResponse, + OperationsListNextResponse, +} from "../models"; + +/// +/** Class containing Operations operations. */ +export class OperationsImpl implements Operations { + private readonly client: CodeSigningManagementClient; + + /** + * Initialize a new instance of the class Operations class. + * @param client Reference to the service client + */ + constructor(client: CodeSigningManagementClient) { + this.client = client; + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + public list( + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); + }, + }; + } + + private async *listPagingPage( + options?: OperationsListOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: OperationsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + options?: OperationsListOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * List the operations for the provider + * @param options The options parameters. + */ + private _list( + options?: OperationsListOptionalParams, + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: OperationsListNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.CodeSigning/operations", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host], + headerParameters: [Parameters.accept], + serializer, +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.OperationListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [Parameters.$host, Parameters.nextLink], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/certificateProfiles.ts b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/certificateProfiles.ts new file mode 100644 index 000000000000..78caef44b189 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/certificateProfiles.ts @@ -0,0 +1,132 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + CertificateProfile, + CertificateProfilesListByCodeSigningAccountOptionalParams, + CertificateProfilesGetOptionalParams, + CertificateProfilesGetResponse, + CertificateProfilesCreateOptionalParams, + CertificateProfilesCreateResponse, + CertificateProfilesDeleteOptionalParams, + CertificateProfilesDeleteResponse, + RevokeCertificate, + CertificateProfilesRevokeCertificateOptionalParams, +} from "../models"; + +/// +/** Interface representing a CertificateProfiles. */ +export interface CertificateProfiles { + /** + * List certificate profiles under a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + listByCodeSigningAccount( + resourceGroupName: string, + accountName: string, + options?: CertificateProfilesListByCodeSigningAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get details of a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + profileName: string, + options?: CertificateProfilesGetOptionalParams, + ): Promise; + /** + * Create a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param resource Parameters to create the certificate profile + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + accountName: string, + profileName: string, + resource: CertificateProfile, + options?: CertificateProfilesCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CertificateProfilesCreateResponse + > + >; + /** + * Create a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param resource Parameters to create the certificate profile + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + accountName: string, + profileName: string, + resource: CertificateProfile, + options?: CertificateProfilesCreateOptionalParams, + ): Promise; + /** + * Delete a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + profileName: string, + options?: CertificateProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CertificateProfilesDeleteResponse + > + >; + /** + * Delete a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + profileName: string, + options?: CertificateProfilesDeleteOptionalParams, + ): Promise; + /** + * Revoke a certificate under a certificate profile. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param profileName Certificate profile name. + * @param body Parameters to revoke the certificate profile + * @param options The options parameters. + */ + revokeCertificate( + resourceGroupName: string, + accountName: string, + profileName: string, + body: RevokeCertificate, + options?: CertificateProfilesRevokeCertificateOptionalParams, + ): Promise; +} diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/codeSigningAccounts.ts b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/codeSigningAccounts.ts new file mode 100644 index 000000000000..989396c546ca --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/codeSigningAccounts.ts @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + CodeSigningAccount, + CodeSigningAccountsListBySubscriptionOptionalParams, + CodeSigningAccountsListByResourceGroupOptionalParams, + CheckNameAvailability, + CodeSigningAccountsCheckNameAvailabilityOptionalParams, + CodeSigningAccountsCheckNameAvailabilityResponse, + CodeSigningAccountsGetOptionalParams, + CodeSigningAccountsGetResponse, + CodeSigningAccountsCreateOptionalParams, + CodeSigningAccountsCreateResponse, + CodeSigningAccountPatch, + CodeSigningAccountsUpdateOptionalParams, + CodeSigningAccountsUpdateResponse, + CodeSigningAccountsDeleteOptionalParams, + CodeSigningAccountsDeleteResponse, +} from "../models"; + +/// +/** Interface representing a CodeSigningAccounts. */ +export interface CodeSigningAccounts { + /** + * Lists trusted signing accounts within a subscription. + * @param options The options parameters. + */ + listBySubscription( + options?: CodeSigningAccountsListBySubscriptionOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Lists trusted signing accounts within a resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: CodeSigningAccountsListByResourceGroupOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Checks that the trusted signing account name is valid and is not already in use. + * @param body The CheckAvailability request + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailability, + options?: CodeSigningAccountsCheckNameAvailabilityOptionalParams, + ): Promise; + /** + * Get a trusted Signing Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + options?: CodeSigningAccountsGetOptionalParams, + ): Promise; + /** + * Create a trusted Signing Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param resource Parameters to create the trusted signing account + * @param options The options parameters. + */ + beginCreate( + resourceGroupName: string, + accountName: string, + resource: CodeSigningAccount, + options?: CodeSigningAccountsCreateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CodeSigningAccountsCreateResponse + > + >; + /** + * Create a trusted Signing Account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param resource Parameters to create the trusted signing account + * @param options The options parameters. + */ + beginCreateAndWait( + resourceGroupName: string, + accountName: string, + resource: CodeSigningAccount, + options?: CodeSigningAccountsCreateOptionalParams, + ): Promise; + /** + * Update a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param properties Parameters supplied to update the trusted signing account + * @param options The options parameters. + */ + beginUpdate( + resourceGroupName: string, + accountName: string, + properties: CodeSigningAccountPatch, + options?: CodeSigningAccountsUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CodeSigningAccountsUpdateResponse + > + >; + /** + * Update a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param properties Parameters supplied to update the trusted signing account + * @param options The options parameters. + */ + beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + properties: CodeSigningAccountPatch, + options?: CodeSigningAccountsUpdateOptionalParams, + ): Promise; + /** + * Delete a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + accountName: string, + options?: CodeSigningAccountsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + CodeSigningAccountsDeleteResponse + > + >; + /** + * Delete a trusted signing account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Trusted Signing account name. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + accountName: string, + options?: CodeSigningAccountsDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/index.ts b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/index.ts new file mode 100644 index 000000000000..42c7309720f0 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/index.ts @@ -0,0 +1,11 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export * from "./operations"; +export * from "./codeSigningAccounts"; +export * from "./certificateProfiles"; diff --git a/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/operations.ts b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/operations.ts new file mode 100644 index 000000000000..251f5f582e64 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/operationsInterfaces/operations.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { Operation, OperationsListOptionalParams } from "../models"; + +/// +/** Interface representing a Operations. */ +export interface Operations { + /** + * List the operations for the provider + * @param options The options parameters. + */ + list( + options?: OperationsListOptionalParams, + ): PagedAsyncIterableIterator; +} diff --git a/sdk/trustedsigning/arm-trustedsigning/src/pagingHelper.ts b/sdk/trustedsigning/arm-trustedsigning/src/pagingHelper.ts new file mode 100644 index 000000000000..205cccc26592 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined, +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/trustedsigning/arm-trustedsigning/test/sampleTest.ts b/sdk/trustedsigning/arm-trustedsigning/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/trustedsigning/arm-trustedsigning/tsconfig.json b/sdk/trustedsigning/arm-trustedsigning/tsconfig.json new file mode 100644 index 000000000000..3e6ae96443f3 --- /dev/null +++ b/sdk/trustedsigning/arm-trustedsigning/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "module": "es6", + "moduleResolution": "node", + "strict": true, + "target": "es6", + "sourceMap": true, + "declarationMap": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "forceConsistentCasingInFileNames": true, + "lib": [ + "es6", + "dom" + ], + "declaration": true, + "outDir": "./dist-esm", + "importHelpers": true + }, + "include": [ + "./src/**/*.ts", + "./test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/sdk/trustedsigning/ci.mgmt.yml b/sdk/trustedsigning/ci.mgmt.yml new file mode 100644 index 000000000000..cf6e89794538 --- /dev/null +++ b/sdk/trustedsigning/ci.mgmt.yml @@ -0,0 +1,38 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/trustedsigning/arm-trustedsigning + - sdk/trustedsigning/ci.mgmt.yml + +pr: + branches: + include: + - main + - feature/* + - release/* + - hotfix/* + exclude: + - feature/v4 + paths: + include: + - sdk/trustedsigning/arm-trustedsigning + - sdk/trustedsigning/ci.mgmt.yml + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: trustedsigning + Artifacts: + - name: azure-arm-trustedsigning + safeName: azurearmtrustedsigning + \ No newline at end of file