From bd6086ae62df461cf93c28a11847544b67b2bb99 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 11 Feb 2025 10:14:53 +0000 Subject: [PATCH 1/3] Initialize repository for autorest build 20250211.1 --- eng/Packages.Data.props | 2 +- eng/emitter-package-lock.json | 2491 ++++++++++++++++++++++++++++++--- eng/emitter-package.json | 27 +- 3 files changed, 2289 insertions(+), 231 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index 1bc6a7c29e8ee..c9552d98d7867 100644 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -247,7 +247,7 @@ All should have PrivateAssets="All" set so they don't become package dependencies --> - + diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index d18d034f00705..ade85880b87d0 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,67 +5,67 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20250206.1" + "@azure-tools/typespec-csharp": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-alpha.20250211.1.tgz" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.50.0", - "@azure-tools/typespec-azure-core": "0.50.0", - "@azure-tools/typespec-azure-resource-manager": "0.50.0", - "@azure-tools/typespec-azure-rulesets": "0.50.0", - "@azure-tools/typespec-client-generator-core": "0.50.2", + "@azure-tools/typespec-autorest": "0.51.0-dev.6", + "@azure-tools/typespec-azure-core": "0.51.0-dev.2", + "@azure-tools/typespec-azure-resource-manager": "0.51.0-dev.9", + "@azure-tools/typespec-azure-rulesets": "0.51.0-dev.2", + "@azure-tools/typespec-client-generator-core": "0.51.0-dev.15", "@azure-tools/typespec-liftr-base": "0.6.0", - "@typespec/compiler": "0.64.0", - "@typespec/http": "0.64.0", - "@typespec/openapi": "0.64.0", - "@typespec/rest": "0.64.0", - "@typespec/versioning": "0.64.0", - "@typespec/xml": "0.64.0" + "@typespec/compiler": "0.65.0-dev.24", + "@typespec/http": "0.65.0-dev.5", + "@typespec/openapi": "0.65.0-dev.4", + "@typespec/rest": "0.65.0-dev.3", + "@typespec/versioning": "0.65.0-dev.5", + "@typespec/xml": "0.65.0-dev.2" } }, "node_modules/@autorest/csharp": { - "version": "3.0.0-beta.20250206.1", - "resolved": "https://registry.npmjs.org/@autorest/csharp/-/csharp-3.0.0-beta.20250206.1.tgz", - "integrity": "sha512-nAeSDvYRo/dRQaZXl6lW+gBAUDIbq/n/B2wnozyKjLepYs+B/ilEohqASqEVodzRN0BiAhs7AkGhNJXfyvePWA==" + "version": "3.0.0-alpha.20250211.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/@autorest/csharp/-/csharp-3.0.0-alpha.20250211.1.tgz", + "integrity": "sha512-l6XbXvVzCIl8F1uGTLxp7pHIDpK0vAt2YlP8clxFdCFVSwRF5GUHBBj6TfhNGjxH7NFKJgI6OfCwEVJa1KW5bg==" }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.50.0.tgz", - "integrity": "sha512-CYzqN11NGU2HNJcycph7HCpjQoOR+XzyySDi6Z6rsXhZa/XTPDYJtmGHNVHXYGgvxJPxPJ9jm13DiLf/ReJnSA==", + "version": "0.51.0-dev.6", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.51.0-dev.6.tgz", + "integrity": "sha512-WZDoTDeupXjLeeeVaqinoyc3HEAdv0rxJt9R1oDNw3ssvTp9/d7fIHLjDoUVTPv3cj+/qCpQtjoyQgCZCIaS2Q==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.50.0", - "@azure-tools/typespec-azure-resource-manager": "~0.50.0", - "@azure-tools/typespec-client-generator-core": "~0.50.0", - "@typespec/compiler": "~0.64.0", - "@typespec/http": "~0.64.0", - "@typespec/openapi": "~0.64.0", - "@typespec/rest": "~0.64.0", - "@typespec/versioning": "~0.64.0" + "@azure-tools/typespec-azure-core": "~0.50.0 || >=0.51.0-dev <0.51.0", + "@azure-tools/typespec-azure-resource-manager": "~0.50.0 || >=0.51.0-dev <0.51.0", + "@azure-tools/typespec-client-generator-core": "~0.50.3 || >=0.51.0-dev <0.51.0", + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/http": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/openapi": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/rest": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/versioning": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.50.0.tgz", - "integrity": "sha512-6kUhWNQc4Btgx7rIbx3dubBLst73qv04dGWg0yNoVi86iIXy+8wr4ee6pgk+niMsZDeHEBEWeeLy9VwCg3MgTg==", + "version": "0.51.0-dev.2", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.51.0-dev.2.tgz", + "integrity": "sha512-VLnezDJODjKY0I/6YCCfPPA8L/8JAkruVdX2kmPzMTKADFDufUd0xpohcmzTY58FmL8RW4tVWgq78yNQ+lBcSA==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.64.0", - "@typespec/http": "~0.64.0", - "@typespec/rest": "~0.64.0" + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/http": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/rest": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.50.0.tgz", - "integrity": "sha512-ekLAyPyy9eMMqdi3pj3g+iw9NNiK6ObDIU/W/bwSBSPwN2Po9d46fb65vcsjPeEkBceeRIPP6p54QtG9JYhSfg==", + "version": "0.51.0-dev.9", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.51.0-dev.9.tgz", + "integrity": "sha512-2qNyveSkM7VMwEG0eamxYS5tCRZVG6zNwQoxMWtLoqsnH3Z5xNGMtlM6c3uHvghqZZ6L4ktOO9Qk3jE/6Icogg==", "dev": true, "license": "MIT", "dependencies": { @@ -76,76 +76,76 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.50.0", - "@typespec/compiler": "~0.64.0", - "@typespec/http": "~0.64.0", - "@typespec/openapi": "~0.64.0", - "@typespec/rest": "~0.64.0", - "@typespec/versioning": "~0.64.0" + "@azure-tools/typespec-azure-core": "~0.50.0 || >=0.51.0-dev <0.51.0", + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/http": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/openapi": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/rest": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/versioning": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.50.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.50.0.tgz", - "integrity": "sha512-b2YjhaUqPxk53eswZKPzK1IzTJJe/AD+Yi/G15+fiar7oozQJtZpe7ysrSsknzKEoy92iiknsIVa5giRie0ATg==", + "version": "0.51.0-dev.2", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.51.0-dev.2.tgz", + "integrity": "sha512-K9k1mgMM6XZkF2zzovBVJlq9/IrwDoTAhXEDEB3f3WYjDb+Umg2tcIhwVSRH9uohZZl9dh7A9+FqmfhOPkVUcg==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.50.0", - "@azure-tools/typespec-azure-resource-manager": "~0.50.0", - "@azure-tools/typespec-client-generator-core": "~0.50.0", - "@typespec/compiler": "~0.64.0" + "@azure-tools/typespec-azure-core": "~0.50.0 || >=0.51.0-dev <0.51.0", + "@azure-tools/typespec-azure-resource-manager": "~0.50.0 || >=0.51.0-dev <0.51.0", + "@azure-tools/typespec-client-generator-core": "~0.50.2 || >=0.51.0-dev <0.51.0", + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.50.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.50.2.tgz", - "integrity": "sha512-xSyJ5OWqu9BToUoQrmoN6a9pxHpTUqDEyc5pmhRwzeuz3zOIvFs2DFKimE2wqVmhFTYg6LTVqle/UU4sr/vdyQ==", + "version": "0.51.0-dev.15", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.51.0-dev.15.tgz", + "integrity": "sha512-XWS0jp0txCgS6BYKb8P29AgZ/pQx+MGbJOn3KmfzBQIOOihlag5lPQmsi2Hv9Gwt058+/jQSp14Pd2BeiQ9img==", "dev": true, "license": "MIT", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0", - "yaml": "~2.5.1" + "yaml": "~2.7.0" }, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.50.0", - "@typespec/compiler": "~0.64.0", - "@typespec/http": "~0.64.0", - "@typespec/openapi": "~0.64.0", - "@typespec/rest": "~0.64.0", - "@typespec/versioning": "~0.64.0", - "@typespec/xml": "~0.64.0" + "@azure-tools/typespec-azure-core": "~0.50.0 || >=0.51.0-dev <0.51.0", + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/http": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/openapi": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/rest": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/versioning": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/xml": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@azure-tools/typespec-csharp": { - "version": "0.2.0-beta.20250206.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-beta.20250206.1.tgz", - "integrity": "sha512-rggeUDMgSBbgM42Q21CWAsW20dR5R36gbmasqoeN9Wh6E2A/mdRbsVZzOZocAvDP3trxqFyvaXvfXWIN7x9G0g==", + "version": "0.2.0-alpha.20250211.1", + "resolved": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-alpha.20250211.1.tgz", + "integrity": "sha512-agoFvfbAAEza4c5uxv/ysuPlGkzZVrOsffDWriC0TGoBO0dwAH+9joxCU0PhYZtZzCFo1zA1bJvLDepW2iYi6g==", "license": "MIT", "dependencies": { - "@autorest/csharp": "3.0.0-beta.20250206.1", + "@autorest/csharp": "3.0.0-alpha.20250211.1", "@typespec/http-client-csharp": "0.1.9-alpha.20250206.2" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.50.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.50.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.50.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.50.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.50.0 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.50.0 <1.0.0 || >=0.51.0-0 <0.51.0", + "@azure-tools/typespec-azure-core": ">=0.50.0 <1.0.0 || >=0.51.0-0 <0.51.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.50.0 <1.0.0 || >=0.51.0-0 <0.51.0", + "@azure-tools/typespec-azure-rulesets": ">=0.50.0 <1.0.0 || >=0.51.0-0 <0.51.0", + "@azure-tools/typespec-client-generator-core": ">=0.50.0 <1.0.0 || >=0.51.0-0 <0.51.0", "@azure-tools/typespec-liftr-base": ">=0.6.0 <1.0.0", - "@typespec/compiler": ">=0.64.0 <1.0.0", - "@typespec/http": ">=0.64.0 <1.0.0", - "@typespec/openapi": ">=0.64.0 <1.0.0", - "@typespec/rest": ">=0.64.0 <1.0.0", - "@typespec/versioning": ">=0.64.0 <1.0.0", - "@typespec/xml": ">=0.64.0 <1.0.0" + "@typespec/compiler": ">=0.64.0 <1.0.0 || >=0.65.0-0 <0.65.0", + "@typespec/http": ">=0.64.0 <1.0.0 || >=0.65.0-0 <0.65.0", + "@typespec/openapi": ">=0.64.0 <1.0.0 || >=0.65.0-0 <0.65.0", + "@typespec/rest": ">=0.64.0 <1.0.0 || >=0.65.0-0 <0.65.0", + "@typespec/versioning": ">=0.64.0 <1.0.0 || >=0.65.0-0 <0.65.0", + "@typespec/xml": ">=0.64.0 <1.0.0 || >=0.65.0-0 <0.65.0" } }, "node_modules/@azure-tools/typespec-liftr-base": { @@ -155,13 +155,14 @@ "dev": true }, "node_modules/@babel/code-frame": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.9.tgz", - "integrity": "sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ==", + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/highlight": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", "picocolors": "^1.0.0" }, "engines": { @@ -178,22 +179,44 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/highlight": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.9.tgz", - "integrity": "sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==", + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" }, "engines": { - "node": ">=6.9.0" + "node": ">=12" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" } }, + "node_modules/@isaacs/string-locale-compare": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz", + "integrity": "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==", + "dev": true, + "license": "ISC" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -232,6 +255,340 @@ "node": ">= 8" } }, + "node_modules/@npmcli/agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-3.0.0.tgz", + "integrity": "sha512-S79NdEgDQd/NGCay6TCoVzXSj74skRZIKJcpJjC5lOq34SZzyI6MqtiiWoiVWoVrTcGjNeC4ipbh1VIHlpfF5Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "agent-base": "^7.1.0", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.1", + "lru-cache": "^10.0.1", + "socks-proxy-agent": "^8.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/arborist": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-9.0.0.tgz", + "integrity": "sha512-ZFsI/VJ7wJ2rTksLNJ9xqr75Ste/wiKvW+7w12ZGbcT67xWii97yS+aDlh3edNhqlqoXvdzYG4hTNui81VxJCA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/string-locale-compare": "^1.1.0", + "@npmcli/fs": "^4.0.0", + "@npmcli/installed-package-contents": "^3.0.0", + "@npmcli/map-workspaces": "^4.0.1", + "@npmcli/metavuln-calculator": "^9.0.0", + "@npmcli/name-from-folder": "^3.0.0", + "@npmcli/node-gyp": "^4.0.0", + "@npmcli/package-json": "^6.0.1", + "@npmcli/query": "^4.0.0", + "@npmcli/redact": "^3.0.0", + "@npmcli/run-script": "^9.0.1", + "bin-links": "^5.0.0", + "cacache": "^19.0.1", + "common-ancestor-path": "^1.0.1", + "hosted-git-info": "^8.0.0", + "json-stringify-nice": "^1.1.4", + "lru-cache": "^10.2.2", + "minimatch": "^9.0.4", + "nopt": "^8.0.0", + "npm-install-checks": "^7.1.0", + "npm-package-arg": "^12.0.0", + "npm-pick-manifest": "^10.0.0", + "npm-registry-fetch": "^18.0.1", + "pacote": "^21.0.0", + "parse-conflict-json": "^4.0.0", + "proc-log": "^5.0.0", + "proggy": "^3.0.0", + "promise-all-reject-late": "^1.0.0", + "promise-call-limit": "^3.0.1", + "read-package-json-fast": "^4.0.0", + "semver": "^7.3.7", + "ssri": "^12.0.0", + "treeverse": "^3.0.0", + "walk-up-path": "^4.0.0" + }, + "bin": { + "arborist": "bin/index.js" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/@npmcli/fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", + "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/git": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-6.0.1.tgz", + "integrity": "sha512-BBWMMxeQzalmKadyimwb2/VVQyJB01PH0HhVSNLHNBDZN/M/h/02P6f8fxedIiFhpMj11SO9Ep5tKTBE7zL2nw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/promise-spawn": "^8.0.0", + "ini": "^5.0.0", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^10.0.0", + "proc-log": "^5.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/installed-package-contents": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-3.0.0.tgz", + "integrity": "sha512-fkxoPuFGvxyrH+OQzyTkX2LUEamrF4jZSmxjAtPPHHGO0dqsQ8tTKjnIS8SAnPHdk2I03BDtSMR5K/4loKg79Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-bundled": "^4.0.0", + "npm-normalize-package-bin": "^4.0.0" + }, + "bin": { + "installed-package-contents": "bin/index.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/map-workspaces": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-4.0.2.tgz", + "integrity": "sha512-mnuMuibEbkaBTYj9HQ3dMe6L0ylYW+s/gfz7tBDMFY/la0w9Kf44P9aLn4/+/t3aTR3YUHKoT6XQL9rlicIe3Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/name-from-folder": "^3.0.0", + "@npmcli/package-json": "^6.0.0", + "glob": "^10.2.2", + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/metavuln-calculator": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-9.0.0.tgz", + "integrity": "sha512-znLKqdy1ZEGNK3VB9j/RzGyb/P0BJb3fGpvEbHIAyBAXsps2l1ce8SVHfsGAFLl9s8072PxafqTn7RC8wSnQPg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cacache": "^19.0.0", + "json-parse-even-better-errors": "^4.0.0", + "pacote": "^21.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/@npmcli/name-from-folder": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-3.0.0.tgz", + "integrity": "sha512-61cDL8LUc9y80fXn+lir+iVt8IS0xHqEKwPu/5jCjxQTVoSCmkXvw4vbMrzAMtmghz3/AkiBjhHkDKUH+kf7kA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/node-gyp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-4.0.0.tgz", + "integrity": "sha512-+t5DZ6mO/QFh78PByMq1fGSAub/agLJZDRfJRMeOSNCt8s9YVlTjmGpIPwPhvXTGUIJk+WszlT0rQa1W33yzNA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/package-json": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-6.1.1.tgz", + "integrity": "sha512-d5qimadRAUCO4A/Txw71VM7UrRZzV+NPclxz/dc+M6B2oYwjWTjqh8HA/sGQgs9VZuJ6I/P7XIAlJvgrl27ZOw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^6.0.0", + "glob": "^10.2.2", + "hosted-git-info": "^8.0.0", + "json-parse-even-better-errors": "^4.0.0", + "proc-log": "^5.0.0", + "semver": "^7.5.3", + "validate-npm-package-license": "^3.0.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/promise-spawn": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-8.0.2.tgz", + "integrity": "sha512-/bNJhjc+o6qL+Dwz/bqfTQClkEO5nTQ1ZEcdCkAQjhkZMHIh22LPG7fNh1enJP1NKWDqYiiABnjFCY7E0zHYtQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "which": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/query": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-4.0.0.tgz", + "integrity": "sha512-3pPbese0fbCiFJ/7/X1GBgxAKYFE8sxBddA7GtuRmOgNseH4YbGsXJ807Ig3AEwNITjDUISHglvy89cyDJnAwA==", + "dev": true, + "license": "ISC", + "dependencies": { + "postcss-selector-parser": "^6.1.2" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/redact": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-3.1.1.tgz", + "integrity": "sha512-3Hc2KGIkrvJWJqTbvueXzBeZlmvoOxc2jyX00yzr3+sNFquJg0N8hH4SAPLPVrkWIRQICVpVgjrss971awXVnA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/run-script": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-9.0.2.tgz", + "integrity": "sha512-cJXiUlycdizQwvqE1iaAb4VRUM3RX09/8q46zjvy+ct9GhfZRWd7jXYVc1tn/CfRlGPVkX/u4sstRlepsm7hfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/node-gyp": "^4.0.0", + "@npmcli/package-json": "^6.0.0", + "@npmcli/promise-spawn": "^8.0.0", + "node-gyp": "^11.0.0", + "proc-log": "^5.0.0", + "which": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sigstore/bundle": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-3.1.0.tgz", + "integrity": "sha512-Mm1E3/CmDDCz3nDhFKTuYdB47EdRFRQMOE/EAbiG1MJW77/w1b3P7Qx7JSrVJs8PfwOLOVcKQCHErIwCTyPbag==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.4.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sigstore/core/-/core-2.0.0.tgz", + "integrity": "sha512-nYxaSb/MtlSI+JWcwTHQxyNmWeWrUXJJ/G4liLrGG7+tS4vAz6LF3xRXqLH6wPIVUoZQel2Fs4ddLx4NCpiIYg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/protobuf-specs": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.4.0.tgz", + "integrity": "sha512-o09cLSIq9EKyRXwryWDOJagkml9XgQCoCSRjHOnHLnvsivaW7Qznzz6yjfV7PHJHhIvyp8OH7OX8w0Dc5bQK7A==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/sign": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/sign/-/sign-3.1.0.tgz", + "integrity": "sha512-knzjmaOHOov1Ur7N/z4B1oPqZ0QX5geUfhrVaqVlu+hl0EAoL4o+l0MSULINcD5GCWe3Z0+YJO8ues6vFlW0Yw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^3.1.0", + "@sigstore/core": "^2.0.0", + "@sigstore/protobuf-specs": "^0.4.0", + "make-fetch-happen": "^14.0.2", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/tuf": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-3.1.0.tgz", + "integrity": "sha512-suVMQEA+sKdOz5hwP9qNcEjX6B45R+hFFr4LAWzbRc5O+U2IInwvay/bpG5a4s+qR35P/JK/PiKiRGjfuLy1IA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/protobuf-specs": "^0.4.0", + "tuf-js": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@sigstore/verify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-2.1.0.tgz", + "integrity": "sha512-kAAM06ca4CzhvjIZdONAL9+MLppW3K48wOFy1TbuaWFW/OMfl8JuTgW0Bm02JB1WJGT/ET2eqav0KTEKmxqkIA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^3.1.0", + "@sigstore/core": "^2.0.0", + "@sigstore/protobuf-specs": "^0.4.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", @@ -245,26 +602,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@tufjs/canonical-json": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz", + "integrity": "sha512-yVtV8zsdo8qFHe+/3kw81dSLyF7D576A5cCFCi4X7B39tWT7SekaEFUnvnWJHz+9qO7qJTah1JbrDjWKqFtdWA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, + "node_modules/@tufjs/models": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-3.0.1.tgz", + "integrity": "sha512-UUYHISyhCU3ZgN8yaear3cGATHb3SMuKHsQ/nVbHXcmnBf+LzQ/cQfhNG+rfaSHgqGKNEm2cOCLVLELStUQ1JA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/canonical-json": "2.0.0", + "minimatch": "^9.0.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/@typespec/compiler": { - "version": "0.64.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.64.0.tgz", - "integrity": "sha512-LnQGlQMWyqvhGg4Z9iyr5qSBTjI9zd49sodbEJbLafrxbj9pbHyjfSFbvt60gVbfuNvLErsdXvZiqqXV5nZdmQ==", + "version": "0.65.0-dev.24", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.65.0-dev.24.tgz", + "integrity": "sha512-COVNAbFoMdreAhdJHm+viJBbe8/aCjfgWBlJsU9+5EUtuR1xaZgdguGZRl6j+CLA+exYKTYC5NlQHI3YXqD/WA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "~7.25.7", + "@babel/code-frame": "~7.26.2", + "@npmcli/arborist": "^9.0.0", "ajv": "~8.17.1", "change-case": "~5.4.4", "globby": "~14.0.2", "mustache": "~4.2.0", "picocolors": "~1.1.1", - "prettier": "~3.3.3", + "prettier": "~3.4.2", "prompts": "~2.4.2", "semver": "^7.6.3", "temporal-polyfill": "^0.2.5", "vscode-languageserver": "~9.0.1", "vscode-languageserver-textdocument": "~1.0.12", - "yaml": "~2.5.1", + "yaml": "~2.7.0", "yargs": "~17.7.2" }, "bin": { @@ -276,17 +658,17 @@ } }, "node_modules/@typespec/http": { - "version": "0.64.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.64.0.tgz", - "integrity": "sha512-vyyZP3Woo7or/2Oiq1fH+R0X/4WOBDjAlGsb9tLQzswfQHp710kNfiecA10y9gDC/9h+PjKsTElS1RcRRanpwA==", + "version": "0.65.0-dev.5", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.65.0-dev.5.tgz", + "integrity": "sha512-+DaZLzB4AXl9vrXhAsfaxFIh8ql8U/27j/Uznoqc120/MCt5nMVB/oibHUgnaAn+EVr/+X5lw088tR6N4AqH5w==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.64.0", - "@typespec/streams": "~0.64.0" + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/streams": "~0.64.0 || >=0.65.0-dev <0.65.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -313,57 +695,77 @@ } }, "node_modules/@typespec/openapi": { - "version": "0.64.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.64.0.tgz", - "integrity": "sha512-C4sPdj86ejsNkpmEaAMMqQR+0kq4Ayp4sPKvj4OTtawLXacXKzZ9NYng2jrguO6WbLr5f3NyRZKi7Ys2suT27A==", + "version": "0.65.0-dev.4", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.65.0-dev.4.tgz", + "integrity": "sha512-/45oCBq18+7q4nKdLMwBldkpPcHd/iCixMB+zg4vKw4f421mrbrsBciXnuDdZofI5M8vHoDkeWILHjQrab0zxw==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.64.0", - "@typespec/http": "~0.64.0" + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/http": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@typespec/rest": { - "version": "0.64.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.64.0.tgz", - "integrity": "sha512-7+oUajQzOkZPTMtRiGp6hzTTmy7mRaxOYqxIPgDhYyr9I6oQPLAcBsYhFNk/ulcqld/ApaV5ycXaOlK41REOyQ==", + "version": "0.65.0-dev.3", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.65.0-dev.3.tgz", + "integrity": "sha512-456lEM/JN6wnRu/zogy9VLT6L5BeznE3xCIPnB8IOvwsgvVEBxMVplc7XrFzSC9OXCFOo+CZZN10FzufSDV5uw==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.64.0", - "@typespec/http": "~0.64.0" + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0", + "@typespec/http": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@typespec/versioning": { - "version": "0.64.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.64.0.tgz", - "integrity": "sha512-GtmuE7UwVYuVwgSpbSWzZB5UO6O/f/o1NqjLStctF8zkv2/5s+RbeqRyamjDuUyhMrIwqw+TMXtAnMXpSHlB8A==", + "version": "0.65.0-dev.5", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.65.0-dev.5.tgz", + "integrity": "sha512-RK+wrDF45bjJ4VlPwwae16XBRWMI0ngYu7qEqXzinkkPcsKGBUzeAv/Hpyc9vtWacYC2/1avSyayPSl8/HwwNw==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.64.0" + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0" } }, "node_modules/@typespec/xml": { - "version": "0.64.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.64.0.tgz", - "integrity": "sha512-Sk+5S2C4YK+fqSadAlzRBSZbhvtDtxLQUS+vrYgiqzVS1F61nUmP7gQGUj+Kps7ncZSppPZystWJJnF7K34UJg==", + "version": "0.65.0-dev.2", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.65.0-dev.2.tgz", + "integrity": "sha512-g5ShLeW7Lgif9Ss9UMjDBEsPU1eJV3AukUyg7uw1wneaRWlfBB9Kw4xzc6S/94lK08DqKZNSRh4SymIG+iMPkQ==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.64.0" + "@typespec/compiler": "~0.64.0 || >=0.65.0-dev <0.65.0" + } + }, + "node_modules/abbrev": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.0.tgz", + "integrity": "sha512-+/kfrslGQ7TNV2ecmQwMJj/B65g5KVq1/L3SGVZ3tCYGqlzFuFCGBZJtMP99wH3NpEUyAjn0zPdPUg0D+DwrOA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" } }, "node_modules/ajv": { @@ -384,26 +786,63 @@ } }, "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bin-links": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-5.0.0.tgz", + "integrity": "sha512-sdleLVfCjBtgO5cNjA2HVRvWBJAHs4zwenaCPMNJAJU0yNxpzj80IpjOIimkpkr+mhlA+how5poQtt53PygbHA==", + "dev": true, + "license": "ISC", "dependencies": { - "color-convert": "^1.9.0" + "cmd-shim": "^7.0.0", + "npm-normalize-package-bin": "^4.0.0", + "proc-log": "^5.0.0", + "read-cmd-shim": "^5.0.0", + "write-file-atomic": "^6.0.0" }, "engines": { - "node": ">=4" + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -419,19 +858,28 @@ "node": ">=8" } }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/cacache": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", + "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "@npmcli/fs": "^4.0.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" }, "engines": { - "node": ">=4" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/change-case": { @@ -441,6 +889,16 @@ "dev": true, "license": "MIT" }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -456,50 +914,250 @@ "node": ">=12" } }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", - "dependencies": { - "color-name": "1.1.3" + "engines": { + "node": ">=8" } }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } }, - "node_modules/emoji-regex": { + "node_modules/cliui/node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true, "license": "MIT" }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", - "engines": { + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/cmd-shim": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-7.0.0.tgz", + "integrity": "sha512-rtpaCbr164TPPh+zFdkWpCyZuKkjpAzODfaZCf/SVJZzJN+4bHQb/LP3Jzq5/+84um3XXY8r548XiWKSborwVw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/common-ancestor-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", + "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==", + "dev": true, + "license": "ISC" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { "node": ">=6" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "license": "MIT", "engines": { - "node": ">=0.8.0" + "node": ">=6" } }, + "node_modules/exponential-backoff": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.2.tgz", + "integrity": "sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -564,6 +1222,36 @@ "node": ">=8" } }, + "node_modules/foreground-child": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -574,6 +1262,27 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/glob": { + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -608,14 +1317,73 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/hosted-git-info": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.0.2.tgz", + "integrity": "sha512-sYKnA7eGln5ov8T8gnYlkSOxFJvywzEx9BueN6xo/GKO8PGiI6uK6xx+DIGe45T3bdVjLAQDQW1aicT8z8JwQg==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^10.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", "dev": true, "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, "engines": { - "node": ">=4" + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, "node_modules/ignore": { @@ -628,6 +1396,53 @@ "node": ">= 4" } }, + "node_modules/ignore-walk": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-7.0.0.tgz", + "integrity": "sha512-T4gbf83A4NH95zvhVYZc+qWocBBGlpzUXLPGurJggw/WIOwicfXJChLDP/iBZnN5WqROSu5Bm3hhle4z8a8YGQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "minimatch": "^9.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/ini": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-5.0.0.tgz", + "integrity": "sha512-+N0ngpO3e7cRUWOJAS7qw0IZIVc6XPrW4MlFBdD066F2L4k1L6ker3hLqSq7iXxU5tgS4WGkIUElWn5vogAEnw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -671,6 +1486,32 @@ "node": ">=0.12.0" } }, + "node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -678,6 +1519,23 @@ "dev": true, "license": "MIT" }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-even-better-errors": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-4.0.0.tgz", + "integrity": "sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -691,20 +1549,84 @@ "integrity": "sha512-SnNMfW2RRPDXIMKa8zdLb59UjMSI1UFZCtIb8ae68GcZ0a6x8b77lIWqqTOdq1azzmkXupD6UWriPLd0JCrFng==", "license": "MIT" }, - "node_modules/kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "node_modules/json-stringify-nice": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz", + "integrity": "sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=6" + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "node_modules/jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", + "dev": true, + "engines": [ + "node >= 0.2.0" + ], + "license": "MIT" + }, + "node_modules/just-diff": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-6.0.2.tgz", + "integrity": "sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==", + "dev": true, + "license": "MIT" + }, + "node_modules/just-diff-apply": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.5.0.tgz", + "integrity": "sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/make-fetch-happen": { + "version": "14.0.3", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-14.0.3.tgz", + "integrity": "sha512-QMjGbFTP0blj97EeidG5hk/QhKQ3T4ICckQGLgz38QF7Vgbk6e6FTARN8KhKxyBbWn8R0HU+bnw8aSoFPD4qtQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/agent": "^3.0.0", + "cacache": "^19.0.1", + "http-cache-semantics": "^4.1.1", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^1.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "ssri": "^12.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true, "license": "MIT", "engines": { @@ -725,6 +1647,199 @@ "node": ">=8.6" } }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-4.0.0.tgz", + "integrity": "sha512-2v6aXUXwLP1Epd/gc32HAMIWoczx+fZwEPRHm/VwtrJzRGwR1qGZXEYV3Zp8ZjjbwaZhMrM6uHV4KVkk+XCc2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.3", + "minipass-sized": "^1.0.3", + "minizlib": "^3.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-flush/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, "node_modules/mustache": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", @@ -735,6 +1850,363 @@ "mustache": "bin/mustache" } }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/node-gyp": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.1.0.tgz", + "integrity": "sha512-/+7TuHKnBpnMvUQnsYEb0JOozDZqarQbfNuSGLXIjhStMT0fbw7IdSqWgopOP5xhRZE+lsbIvAHcekddruPZgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.0", + "exponential-backoff": "^3.1.1", + "glob": "^10.3.10", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^14.0.3", + "nopt": "^8.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5", + "tar": "^7.4.3", + "which": "^5.0.0" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/nopt": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-8.1.0.tgz", + "integrity": "sha512-ieGu42u/Qsa4TFktmaKEwM6MQH0pOWnaB3htzh0JRtx84+Mebc0cbZYN5bC+6WTZ4+77xrL9Pn5m7CV6VIkV7A==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^3.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-bundled": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-4.0.0.tgz", + "integrity": "sha512-IxaQZDMsqfQ2Lz37VvyyEtKLe8FsRZuysmedy/N06TU1RyVppYKXrO4xIhR0F+7ubIBox6Q7nir6fQI3ej39iA==", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-normalize-package-bin": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-install-checks": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-7.1.1.tgz", + "integrity": "sha512-u6DCwbow5ynAX5BdiHQ9qvexme4U3qHW3MWe5NqH+NeBm0LbiH6zvGjNNew1fY+AZZUtVHbOPF3j7mJxbUzpXg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-normalize-package-bin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-4.0.0.tgz", + "integrity": "sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-package-arg": { + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-12.0.2.tgz", + "integrity": "sha512-f1NpFjNI9O4VbKMOlA5QoBq/vSQPORHcTZ2feJpFkTHJ9eQkdlmZEKSjcAhxTGInC7RlEyScT9ui67NaOsjFWA==", + "dev": true, + "license": "ISC", + "dependencies": { + "hosted-git-info": "^8.0.0", + "proc-log": "^5.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^6.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-packlist": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-10.0.0.tgz", + "integrity": "sha512-rht9U6nS8WOBDc53eipZNPo5qkAV4X2rhKE2Oj1DYUQ3DieXfj0mKkVmjnf3iuNdtMd8WfLdi2L6ASkD/8a+Kg==", + "dev": true, + "license": "ISC", + "dependencies": { + "ignore-walk": "^7.0.0" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/npm-pick-manifest": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-10.0.0.tgz", + "integrity": "sha512-r4fFa4FqYY8xaM7fHecQ9Z2nE9hgNfJR+EmoKv0+chvzWkBcORX3r0FpTByP+CbOVJDladMXnPQGVN8PBLGuTQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-install-checks": "^7.1.0", + "npm-normalize-package-bin": "^4.0.0", + "npm-package-arg": "^12.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/npm-registry-fetch": { + "version": "18.0.2", + "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-18.0.2.tgz", + "integrity": "sha512-LeVMZBBVy+oQb5R6FDV9OlJCcWDU+al10oKpe+nsvcHnG24Z3uM3SvJYKfGJlfGjVU8v9liejCrUR/M5HO5NEQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/redact": "^3.0.0", + "jsonparse": "^1.3.1", + "make-fetch-happen": "^14.0.0", + "minipass": "^7.0.2", + "minipass-fetch": "^4.0.0", + "minizlib": "^3.0.1", + "npm-package-arg": "^12.0.0", + "proc-log": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/p-map": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.3.tgz", + "integrity": "sha512-VkndIv2fIB99swvQoA65bm+fsmt6UNdGeIB0oxBs+WhAhdh08QA04JXpI7rbB9r08/nkbysKoya9rtDERYOYMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/pacote": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/pacote/-/pacote-21.0.0.tgz", + "integrity": "sha512-lcqexq73AMv6QNLo7SOpz0JJoaGdS3rBFgF122NZVl1bApo2mfu+XzUBU/X/XsiJu+iUmKpekRayqQYAs+PhkA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/git": "^6.0.0", + "@npmcli/installed-package-contents": "^3.0.0", + "@npmcli/package-json": "^6.0.0", + "@npmcli/promise-spawn": "^8.0.0", + "@npmcli/run-script": "^9.0.0", + "cacache": "^19.0.0", + "fs-minipass": "^3.0.0", + "minipass": "^7.0.2", + "npm-package-arg": "^12.0.0", + "npm-packlist": "^10.0.0", + "npm-pick-manifest": "^10.0.0", + "npm-registry-fetch": "^18.0.0", + "proc-log": "^5.0.0", + "promise-retry": "^2.0.1", + "sigstore": "^3.0.0", + "ssri": "^12.0.0", + "tar": "^6.1.11" + }, + "bin": { + "pacote": "bin/index.js" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/pacote/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/pacote/node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/pacote/node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pacote/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pacote/node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "dev": true, + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pacote/node_modules/tar/node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/pacote/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pacote/node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/pacote/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + }, + "node_modules/parse-conflict-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-4.0.0.tgz", + "integrity": "sha512-37CN2VtcuvKgHUs8+0b1uJeEsbGn61GRHz469C94P5xiOoqpDYJYwjg4RY9Vmz39WyZAVkR5++nbJwLMIgOCnQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "json-parse-even-better-errors": "^4.0.0", + "just-diff": "^6.0.0", + "just-diff-apply": "^5.2.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-type": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", @@ -778,10 +2250,24 @@ "node": ">=4" } }, + "node_modules/postcss-selector-parser": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", + "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", "dev": true, "license": "MIT", "bin": { @@ -794,6 +2280,67 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/proc-log": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz", + "integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/proggy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/proggy/-/proggy-3.0.0.tgz", + "integrity": "sha512-QE8RApCM3IaRRxVzxrjbgNMpQEX6Wu0p0KBeoSiSEw5/bsGwZHsshF4LCxH2jp/r6BU+bqA3LrMDEYNfJnpD8Q==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/promise-all-reject-late": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz", + "integrity": "sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==", + "dev": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/promise-call-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-3.0.2.tgz", + "integrity": "sha512-mRPQO2T1QQVw11E7+UdCJu7S61eJVWknzml9sC1heAdj1jxl0fWMBypIt9ZOcLFf8FkG995ZD7RnVk7HH72fZw==", + "dev": true, + "license": "ISC", + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -829,6 +2376,30 @@ ], "license": "MIT" }, + "node_modules/read-cmd-shim": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-5.0.0.tgz", + "integrity": "sha512-SEbJV7tohp3DAAILbEMPXavBjAnMN0tVnh4+9G8ihV4Pq3HYF9h8QNez9zkJ1ILkv9G2BjdzwctznGZXgu/HGw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/read-package-json-fast": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-4.0.0.tgz", + "integrity": "sha512-qpt8EwugBWDw2cgE2W+/3oxC+KTez2uSVR8JU9Q36TXPAGCaozfQUs59v4j4GFpWTaw0i6hAZSvOmu1J0uOEUg==", + "dev": true, + "license": "ISC", + "dependencies": { + "json-parse-even-better-errors": "^4.0.0", + "npm-normalize-package-bin": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -849,6 +2420,16 @@ "node": ">=0.10.0" } }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -860,6 +2441,22 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -881,43 +2478,221 @@ ], "license": "MIT", "dependencies": { - "queue-microtask": "^1.2.2" + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sigstore": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/sigstore/-/sigstore-3.1.0.tgz", + "integrity": "sha512-ZpzWAFHIFqyFE56dXqgX/DkDRZdz+rRcjoIk/RQU4IX0wiCv1l8S7ZrXDHcCc+uaf+6o7w3h2l3g6GYG5TKN9Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@sigstore/bundle": "^3.1.0", + "@sigstore/core": "^2.0.0", + "@sigstore/protobuf-specs": "^0.4.0", + "@sigstore/sign": "^3.1.0", + "@sigstore/tuf": "^3.1.0", + "@sigstore/verify": "^2.1.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", + "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/spdx-correct": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz", + "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", + "dev": true, + "license": "CC-BY-3.0" + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, - "node_modules/semver": { - "version": "7.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", - "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "node_modules/spdx-license-ids": { + "version": "3.0.21", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.21.tgz", + "integrity": "sha512-Bvg/8F5XephndSK3JffaRqdT+gyhfqIPwDHpX80tJrF8QQRYMo8sNMeaZ2Dp5+jhwKnUmIOyFFQfHRkjJm5nXg==", + "dev": true, + "license": "CC0-1.0" + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/ssri": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", + "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", "dev": true, "license": "ISC", - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "minipass": "^7.0.3" }, "engines": { - "node": ">=10" + "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/sisteransi": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", - "dev": true, - "license": "MIT" - }, - "node_modules/slash": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", - "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, "engines": { - "node": ">=14.16" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/string-width": { + "node_modules/string-width-cjs": { + "name": "string-width", "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", @@ -932,7 +2707,54 @@ "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -945,17 +2767,32 @@ "node": ">=8" } }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "dev": true, + "license": "ISC", "dependencies": { - "has-flag": "^3.0.0" + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" }, "engines": { - "node": ">=4" + "node": ">=18" } }, "node_modules/temporal-polyfill": { @@ -988,6 +2825,31 @@ "node": ">=8.0" } }, + "node_modules/treeverse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/treeverse/-/treeverse-3.0.0.tgz", + "integrity": "sha512-gcANaAnd2QDZFmHFEOF4k7uc1J/6a6z3DJMd/QwEyxLoKGiptJRwid582r7QIsFlFMIZ3SnxfS52S4hm2DHkuQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/tuf-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-3.0.1.tgz", + "integrity": "sha512-+68OP1ZzSF84rTckf3FA95vJ1Zlx/uaXyiiKyPd1pA4rZNkpEvDAKmsu1xUSmbF/chCRYgZ6UZkDwC7PmzmAyA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tufjs/models": "3.0.1", + "debug": "^4.3.6", + "make-fetch-happen": "^14.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", @@ -1001,6 +2863,60 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/unique-filename": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", + "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "unique-slug": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/unique-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", + "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/validate-npm-package-name": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-6.0.0.tgz", + "integrity": "sha512-d7KLgL1LD3U3fgnvWEY1cQXoO/q6EQ1BSz48Sa149V/5zVTAbgmZIpyI8TRi6U9/JNyeYLlTKsEMPtLC27RFUg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/vscode-jsonrpc": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", @@ -1049,7 +2965,52 @@ "dev": true, "license": "MIT" }, + "node_modules/walk-up-path": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-4.0.0.tgz", + "integrity": "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/which": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-5.0.0.tgz", + "integrity": "sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", @@ -1067,7 +3028,17 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", @@ -1083,25 +3054,54 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=7.0.0" + "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/write-file-atomic": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-6.0.0.tgz", + "integrity": "sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } }, "node_modules/y18n": { "version": "5.0.8", @@ -1113,10 +3113,20 @@ "node": ">=10" } }, + "node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", + "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", "dev": true, "license": "ISC", "bin": { @@ -1154,6 +3164,51 @@ "engines": { "node": ">=12" } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } } } } diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 1750d6cc57793..b4b2016605478 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,20 +1,23 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-csharp": "0.2.0-beta.20250206.1" + "@azure-tools/typespec-csharp": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/@azure-tools/typespec-csharp/-/typespec-csharp-0.2.0-alpha.20250211.1.tgz" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.50.0", - "@azure-tools/typespec-azure-core": "0.50.0", - "@azure-tools/typespec-azure-resource-manager": "0.50.0", - "@azure-tools/typespec-azure-rulesets": "0.50.0", - "@azure-tools/typespec-client-generator-core": "0.50.2", + "@azure-tools/typespec-autorest": "0.51.0-dev.6", + "@azure-tools/typespec-azure-core": "0.51.0-dev.2", + "@azure-tools/typespec-azure-resource-manager": "0.51.0-dev.9", + "@azure-tools/typespec-azure-rulesets": "0.51.0-dev.2", + "@azure-tools/typespec-client-generator-core": "0.51.0-dev.15", "@azure-tools/typespec-liftr-base": "0.6.0", - "@typespec/compiler": "0.64.0", - "@typespec/http": "0.64.0", - "@typespec/openapi": "0.64.0", - "@typespec/rest": "0.64.0", - "@typespec/versioning": "0.64.0", - "@typespec/xml": "0.64.0" + "@typespec/compiler": "0.65.0-dev.24", + "@typespec/http": "0.65.0-dev.5", + "@typespec/openapi": "0.65.0-dev.4", + "@typespec/rest": "0.65.0-dev.3", + "@typespec/versioning": "0.65.0-dev.5", + "@typespec/xml": "0.65.0-dev.2" + }, + "overrides": { + "@autorest/csharp": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js-test-autorest/npm/registry/@autorest/csharp/-/csharp-3.0.0-alpha.20250211.1.tgz" } } From 3699b18aabf3dae97009437d7c1f14df44615b63 Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 11 Feb 2025 10:39:21 +0000 Subject: [PATCH 2/3] Update SDK code de_ex_3 --- .../Generated/EventGridSystemEventsModelFactory.cs | 4 +--- ...ncomingDataChunkDroppedEventData.Serialization.cs | 12 ------------ ...ediaLiveEventIncomingDataChunkDroppedEventData.cs | 6 +----- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs index 3b3868356788f..e700c3d0b9a17 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/EventGridSystemEventsModelFactory.cs @@ -3542,17 +3542,15 @@ public static MediaLiveEventIncomingVideoStreamsOutOfSyncEventData MediaLiveEven /// Gets the timestamp of the data chunk dropped. /// Gets the type of the track (Audio / Video). /// Gets the bitrate of the track. - /// Gets the timescale of the Timestamp. /// Gets the result code for fragment drop operation. /// Gets the name of the track for which fragment is dropped. /// A new instance for mocking. - public static MediaLiveEventIncomingDataChunkDroppedEventData MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp = null, string trackType = null, long? bitrate = null, string timescale = null, string resultCode = null, string trackName = null) + public static MediaLiveEventIncomingDataChunkDroppedEventData MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp = null, string trackType = null, long? bitrate = null, string resultCode = null, string trackName = null) { return new MediaLiveEventIncomingDataChunkDroppedEventData( timestamp, trackType, bitrate, - timescale, resultCode, trackName, serializedAdditionalRawData: null); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs index 25bb532b05462..4692cd59910ef 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.Serialization.cs @@ -49,11 +49,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("bitrate"u8); writer.WriteNumberValue(Bitrate.Value); } - if (Optional.IsDefined(Timescale)) - { - writer.WritePropertyName("timescale"u8); - writer.WriteStringValue(Timescale); - } if (Optional.IsDefined(ResultCode)) { writer.WritePropertyName("resultCode"u8); @@ -104,7 +99,6 @@ internal static MediaLiveEventIncomingDataChunkDroppedEventData DeserializeMedia string timestamp = default; string trackType = default; long? bitrate = default; - string timescale = default; string resultCode = default; string trackName = default; IDictionary serializedAdditionalRawData = default; @@ -130,11 +124,6 @@ internal static MediaLiveEventIncomingDataChunkDroppedEventData DeserializeMedia bitrate = property.Value.GetInt64(); continue; } - if (property.NameEquals("timescale"u8)) - { - timescale = property.Value.GetString(); - continue; - } if (property.NameEquals("resultCode"u8)) { resultCode = property.Value.GetString(); @@ -155,7 +144,6 @@ internal static MediaLiveEventIncomingDataChunkDroppedEventData DeserializeMedia timestamp, trackType, bitrate, - timescale, resultCode, trackName, serializedAdditionalRawData); diff --git a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.cs b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.cs index 55ee088b611cd..c12a9ad19eb9a 100644 --- a/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.cs +++ b/sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents/src/Generated/MediaLiveEventIncomingDataChunkDroppedEventData.cs @@ -54,16 +54,14 @@ internal MediaLiveEventIncomingDataChunkDroppedEventData() /// Gets the timestamp of the data chunk dropped. /// Gets the type of the track (Audio / Video). /// Gets the bitrate of the track. - /// Gets the timescale of the Timestamp. /// Gets the result code for fragment drop operation. /// Gets the name of the track for which fragment is dropped. /// Keeps track of any properties unknown to the library. - internal MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp, string trackType, long? bitrate, string timescale, string resultCode, string trackName, IDictionary serializedAdditionalRawData) + internal MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp, string trackType, long? bitrate, string resultCode, string trackName, IDictionary serializedAdditionalRawData) { Timestamp = timestamp; TrackType = trackType; Bitrate = bitrate; - Timescale = timescale; ResultCode = resultCode; TrackName = trackName; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -75,8 +73,6 @@ internal MediaLiveEventIncomingDataChunkDroppedEventData(string timestamp, strin public string TrackType { get; } /// Gets the bitrate of the track. public long? Bitrate { get; } - /// Gets the timescale of the Timestamp. - public string Timescale { get; } /// Gets the result code for fragment drop operation. public string ResultCode { get; } /// Gets the name of the track for which fragment is dropped. From e3d0b2c4538124627b1a13f2d39581066a0edd9f Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 11 Feb 2025 10:47:41 +0000 Subject: [PATCH 3/3] Update SDK code ad_cl_0 --- .../src/Generated/AIProjectsModelFactory.cs | 295 -- .../src/Generated/AgentStreamEvent.cs | 137 - .../src/Generated/DoneEvent.cs | 48 - .../src/Generated/ErrorEvent.cs | 48 - .../Generated/MessageDelta.Serialization.cs | 160 - .../src/Generated/MessageDelta.cs | 94 - .../MessageDeltaChunk.Serialization.cs | 158 - .../src/Generated/MessageDeltaChunk.cs | 87 - .../src/Generated/MessageDeltaChunkObject.cs | 48 - .../MessageDeltaContent.Serialization.cs | 136 - .../src/Generated/MessageDeltaContent.cs | 80 - ...sageDeltaImageFileContent.Serialization.cs | 147 - .../Generated/MessageDeltaImageFileContent.cs | 41 - ...ltaImageFileContentObject.Serialization.cs | 145 - .../MessageDeltaImageFileContentObject.cs | 65 - ...essageDeltaTextAnnotation.Serialization.cs | 136 - .../Generated/MessageDeltaTextAnnotation.cs | 80 - .../MessageDeltaTextContent.Serialization.cs | 147 - .../src/Generated/MessageDeltaTextContent.cs | 41 - ...ageDeltaTextContentObject.Serialization.cs | 170 - .../MessageDeltaTextContentObject.cs | 78 - ...extFileCitationAnnotation.Serialization.cs | 195 -- .../MessageDeltaTextFileCitationAnnotation.cs | 53 - ...eCitationAnnotationObject.Serialization.cs | 156 - ...geDeltaTextFileCitationAnnotationObject.cs | 69 - ...ltaTextFilePathAnnotation.Serialization.cs | 195 -- .../MessageDeltaTextFilePathAnnotation.cs | 53 - ...tFilePathAnnotationObject.Serialization.cs | 145 - ...essageDeltaTextFilePathAnnotationObject.cs | 65 - .../src/Generated/MessageStreamEvent.cs | 60 - .../Generated/RunStepDelta.Serialization.cs | 149 - .../src/Generated/RunStepDelta.cs | 73 - .../RunStepDeltaChunk.Serialization.cs | 158 - .../src/Generated/RunStepDeltaChunk.cs | 87 - .../src/Generated/RunStepDeltaChunkObject.cs | 48 - ...terpreterDetailItemObject.Serialization.cs | 170 - ...tepDeltaCodeInterpreterDetailItemObject.cs | 82 - ...odeInterpreterImageOutput.Serialization.cs | 147 - .../RunStepDeltaCodeInterpreterImageOutput.cs | 41 - ...erpreterImageOutputObject.Serialization.cs | 145 - ...epDeltaCodeInterpreterImageOutputObject.cs | 65 - ...aCodeInterpreterLogOutput.Serialization.cs | 143 - .../RunStepDeltaCodeInterpreterLogOutput.cs | 41 - ...eltaCodeInterpreterOutput.Serialization.cs | 136 - .../RunStepDeltaCodeInterpreterOutput.cs | 80 - ...taCodeInterpreterToolCall.Serialization.cs | 153 - .../RunStepDeltaCodeInterpreterToolCall.cs | 46 - .../RunStepDeltaDetail.Serialization.cs | 134 - .../src/Generated/RunStepDeltaDetail.cs | 69 - ...epDeltaFileSearchToolCall.Serialization.cs | 164 - .../RunStepDeltaFileSearchToolCall.cs | 47 - .../RunStepDeltaFunction.Serialization.cs | 179 -- .../src/Generated/RunStepDeltaFunction.cs | 73 - ...StepDeltaFunctionToolCall.Serialization.cs | 153 - .../Generated/RunStepDeltaFunctionToolCall.cs | 46 - ...nStepDeltaMessageCreation.Serialization.cs | 141 - .../Generated/RunStepDeltaMessageCreation.cs | 34 - ...eltaMessageCreationObject.Serialization.cs | 145 - .../RunStepDeltaMessageCreationObject.cs | 65 - .../RunStepDeltaToolCall.Serialization.cs | 139 - .../src/Generated/RunStepDeltaToolCall.cs | 89 - ...unStepDeltaToolCallObject.Serialization.cs | 151 - .../Generated/RunStepDeltaToolCallObject.cs | 43 - .../src/Generated/RunStepStreamEvent.cs | 66 - .../src/Generated/RunStreamEvent.cs | 75 - .../src/Generated/ThreadStreamEvent.cs | 48 - ...nknownMessageDeltaContent.Serialization.cs | 132 - .../Generated/UnknownMessageDeltaContent.cs | 29 - ...essageDeltaTextAnnotation.Serialization.cs | 132 - .../UnknownMessageDeltaTextAnnotation.cs | 29 - ...eltaCodeInterpreterOutput.Serialization.cs | 132 - ...nknownRunStepDeltaCodeInterpreterOutput.cs | 29 - ...UnknownRunStepDeltaDetail.Serialization.cs | 126 - .../Generated/UnknownRunStepDeltaDetail.cs | 28 - ...knownRunStepDeltaToolCall.Serialization.cs | 138 - .../Generated/UnknownRunStepDeltaToolCall.cs | 30 - .../src/Generated/Docs/BatchClient.xml | 2816 ++++++++++++++++- .../Generated/Samples/Samples_BatchClient.cs | 2816 ++++++++++++++++- 78 files changed, 5396 insertions(+), 7998 deletions(-) delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/DoneEvent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/ErrorEvent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunkObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/MessageStreamEvent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunkObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStepStreamEvent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/ThreadStreamEvent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.Serialization.cs delete mode 100644 sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.cs diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs index 546d614966d87..c31eb49ed837e 100644 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs +++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs @@ -621,300 +621,5 @@ public static VectorStoreFileBatch VectorStoreFileBatch(string id = null, Vector fileCounts, serializedAdditionalRawData: null); } - - /// Initializes a new instance of . - /// The identifier of the message, which can be referenced in API endpoints. - /// The object type, which is always `thread.message.delta`. - /// The delta containing the fields that have changed on the Message. - /// A new instance for mocking. - public static MessageDeltaChunk MessageDeltaChunk(string id = null, MessageDeltaChunkObject @object = default, MessageDelta delta = null) - { - return new MessageDeltaChunk(id, @object, delta, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The entity that produced the message. - /// - /// The content of the message as an array of text and/or images. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// A new instance for mocking. - public static MessageDelta MessageDelta(MessageRole role = default, IEnumerable content = null) - { - content ??= new List(); - - return new MessageDelta(role, content?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the content part of the message. - /// The type of content for this content part. - /// A new instance for mocking. - public static MessageDeltaContent MessageDeltaContent(int index = default, string type = null) - { - return new UnknownMessageDeltaContent(index, type, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the content part of the message. - /// The image_file data. - /// A new instance for mocking. - public static MessageDeltaImageFileContent MessageDeltaImageFileContent(int index = default, MessageDeltaImageFileContentObject imageFile = null) - { - return new MessageDeltaImageFileContent(index, "image_file", serializedAdditionalRawData: null, imageFile); - } - - /// Initializes a new instance of . - /// The file ID of the image in the message content. - /// A new instance for mocking. - public static MessageDeltaImageFileContentObject MessageDeltaImageFileContentObject(string fileId = null) - { - return new MessageDeltaImageFileContentObject(fileId, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the content part of the message. - /// The text content details. - /// A new instance for mocking. - public static MessageDeltaTextContent MessageDeltaTextContent(int index = default, MessageDeltaTextContentObject text = null) - { - return new MessageDeltaTextContent(index, "text", serializedAdditionalRawData: null, text); - } - - /// Initializes a new instance of . - /// The data that makes up the text. - /// - /// Annotations for the text. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// A new instance for mocking. - public static MessageDeltaTextContentObject MessageDeltaTextContentObject(string value = null, IEnumerable annotations = null) - { - annotations ??= new List(); - - return new MessageDeltaTextContentObject(value, annotations?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - /// The type of the text content annotation. - /// A new instance for mocking. - public static MessageDeltaTextAnnotation MessageDeltaTextAnnotation(int index = default, string type = null) - { - return new UnknownMessageDeltaTextAnnotation(index, type, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - /// The file citation information. - /// The text in the message content that needs to be replaced. - /// The start index of this annotation in the content text. - /// The end index of this annotation in the content text. - /// A new instance for mocking. - public static MessageDeltaTextFileCitationAnnotation MessageDeltaTextFileCitationAnnotation(int index = default, MessageDeltaTextFileCitationAnnotationObject fileCitation = null, string text = null, int? startIndex = null, int? endIndex = null) - { - return new MessageDeltaTextFileCitationAnnotation( - index, - "file_citation", - serializedAdditionalRawData: null, - fileCitation, - text, - startIndex, - endIndex); - } - - /// Initializes a new instance of . - /// The ID of the specific file the citation is from. - /// The specific quote in the cited file. - /// A new instance for mocking. - public static MessageDeltaTextFileCitationAnnotationObject MessageDeltaTextFileCitationAnnotationObject(string fileId = null, string quote = null) - { - return new MessageDeltaTextFileCitationAnnotationObject(fileId, quote, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - /// The file path information. - /// The start index of this annotation in the content text. - /// The end index of this annotation in the content text. - /// The text in the message content that needs to be replaced. - /// A new instance for mocking. - public static MessageDeltaTextFilePathAnnotation MessageDeltaTextFilePathAnnotation(int index = default, MessageDeltaTextFilePathAnnotationObject filePath = null, int? startIndex = null, int? endIndex = null, string text = null) - { - return new MessageDeltaTextFilePathAnnotation( - index, - "file_path", - serializedAdditionalRawData: null, - filePath, - startIndex, - endIndex, - text); - } - - /// Initializes a new instance of . - /// The file ID for the annotation. - /// A new instance for mocking. - public static MessageDeltaTextFilePathAnnotationObject MessageDeltaTextFilePathAnnotationObject(string fileId = null) - { - return new MessageDeltaTextFilePathAnnotationObject(fileId, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The identifier of the run step, which can be referenced in API endpoints. - /// The object type, which is always `thread.run.step.delta`. - /// The delta containing the fields that have changed on the run step. - /// A new instance for mocking. - public static RunStepDeltaChunk RunStepDeltaChunk(string id = null, RunStepDeltaChunkObject @object = default, RunStepDelta delta = null) - { - return new RunStepDeltaChunk(id, @object, delta, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// The details of the run step. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// A new instance for mocking. - public static RunStepDelta RunStepDelta(RunStepDeltaDetail stepDetails = null) - { - return new RunStepDelta(stepDetails, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The message creation data. - /// A new instance for mocking. - public static RunStepDeltaMessageCreation RunStepDeltaMessageCreation(RunStepDeltaMessageCreationObject messageCreation = null) - { - return new RunStepDeltaMessageCreation("message_creation", serializedAdditionalRawData: null, messageCreation); - } - - /// Initializes a new instance of . - /// The ID of the newly-created message. - /// A new instance for mocking. - public static RunStepDeltaMessageCreationObject RunStepDeltaMessageCreationObject(string messageId = null) - { - return new RunStepDeltaMessageCreationObject(messageId, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// - /// The collection of tool calls for the tool call detail item. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// A new instance for mocking. - public static RunStepDeltaToolCallObject RunStepDeltaToolCallObject(IEnumerable toolCalls = null) - { - toolCalls ??= new List(); - - return new RunStepDeltaToolCallObject("tool_calls", serializedAdditionalRawData: null, toolCalls?.ToList()); - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The type of the tool call detail item in a streaming run step's details. - /// A new instance for mocking. - public static RunStepDeltaToolCall RunStepDeltaToolCall(int index = default, string id = null, string type = null) - { - return new UnknownRunStepDeltaToolCall(index, id, type, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The function data for the tool call. - /// A new instance for mocking. - public static RunStepDeltaFunctionToolCall RunStepDeltaFunctionToolCall(int index = default, string id = null, RunStepDeltaFunction function = null) - { - return new RunStepDeltaFunctionToolCall(index, id, "function", serializedAdditionalRawData: null, function); - } - - /// Initializes a new instance of . - /// The name of the function. - /// The arguments passed to the function as input. - /// The output of the function, null if outputs have not yet been submitted. - /// A new instance for mocking. - public static RunStepDeltaFunction RunStepDeltaFunction(string name = null, string arguments = null, string output = null) - { - return new RunStepDeltaFunction(name, arguments, output, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// Reserved for future use. - /// A new instance for mocking. - public static RunStepDeltaFileSearchToolCall RunStepDeltaFileSearchToolCall(int index = default, string id = null, IReadOnlyDictionary fileSearch = null) - { - fileSearch ??= new Dictionary(); - - return new RunStepDeltaFileSearchToolCall(index, id, "file_search", serializedAdditionalRawData: null, fileSearch); - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The Code Interpreter data for the tool call. - /// A new instance for mocking. - public static RunStepDeltaCodeInterpreterToolCall RunStepDeltaCodeInterpreterToolCall(int index = default, string id = null, RunStepDeltaCodeInterpreterDetailItemObject codeInterpreter = null) - { - return new RunStepDeltaCodeInterpreterToolCall(index, id, "code_interpreter", serializedAdditionalRawData: null, codeInterpreter); - } - - /// Initializes a new instance of . - /// The input into the Code Interpreter tool call. - /// - /// The outputs from the Code Interpreter tool call. Code Interpreter can output one or more - /// items, including text (`logs`) or images (`image`). Each of these are represented by a - /// different object type. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// A new instance for mocking. - public static RunStepDeltaCodeInterpreterDetailItemObject RunStepDeltaCodeInterpreterDetailItemObject(string input = null, IEnumerable outputs = null) - { - outputs ??= new List(); - - return new RunStepDeltaCodeInterpreterDetailItemObject(input, outputs?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - /// The type of the streaming run step tool call's Code Interpreter output. - /// A new instance for mocking. - public static RunStepDeltaCodeInterpreterOutput RunStepDeltaCodeInterpreterOutput(int index = default, string type = null) - { - return new UnknownRunStepDeltaCodeInterpreterOutput(index, type, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - /// The text output from the Code Interpreter tool call. - /// A new instance for mocking. - public static RunStepDeltaCodeInterpreterLogOutput RunStepDeltaCodeInterpreterLogOutput(int index = default, string logs = null) - { - return new RunStepDeltaCodeInterpreterLogOutput(index, "logs", serializedAdditionalRawData: null, logs); - } - - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - /// The image data for the Code Interpreter tool call output. - /// A new instance for mocking. - public static RunStepDeltaCodeInterpreterImageOutput RunStepDeltaCodeInterpreterImageOutput(int index = default, RunStepDeltaCodeInterpreterImageOutputObject image = null) - { - return new RunStepDeltaCodeInterpreterImageOutput(index, "image", serializedAdditionalRawData: null, image); - } - - /// Initializes a new instance of . - /// The file ID for the image. - /// A new instance for mocking. - public static RunStepDeltaCodeInterpreterImageOutputObject RunStepDeltaCodeInterpreterImageOutputObject(string fileId = null) - { - return new RunStepDeltaCodeInterpreterImageOutputObject(fileId, serializedAdditionalRawData: null); - } } } diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs deleted file mode 100644 index 97c4efa2a29ed..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentStreamEvent.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// - /// Each event in a server-sent events stream has an `event` and `data` property: - /// - /// ``` - /// event: thread.created - /// data: {"id": "thread_123", "object": "thread", ...} - /// ``` - /// - /// We emit events whenever a new object is created, transitions to a new state, or is being - /// streamed in parts (deltas). For example, we emit `thread.run.created` when a new run - /// is created, `thread.run.completed` when a run completes, and so on. When an Agent chooses - /// to create a message during a run, we emit a `thread.message.created event`, a - /// `thread.message.in_progress` event, many `thread.message.delta` events, and finally a - /// `thread.message.completed` event. - /// - /// We may add additional events over time, so we recommend handling unknown events gracefully - /// in your code. - /// - public readonly partial struct AgentStreamEvent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AgentStreamEvent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadCreatedValue = "thread.created"; - private const string ThreadRunCreatedValue = "thread.run.created"; - private const string ThreadRunQueuedValue = "thread.run.queued"; - private const string ThreadRunInProgressValue = "thread.run.in_progress"; - private const string ThreadRunRequiresActionValue = "thread.run.requires_action"; - private const string ThreadRunCompletedValue = "thread.run.completed"; - private const string ThreadRunIncompleteValue = "thread.run.incomplete"; - private const string ThreadRunFailedValue = "thread.run.failed"; - private const string ThreadRunCancellingValue = "thread.run.cancelling"; - private const string ThreadRunCancelledValue = "thread.run.cancelled"; - private const string ThreadRunExpiredValue = "thread.run.expired"; - private const string ThreadRunStepCreatedValue = "thread.run.step.created"; - private const string ThreadRunStepInProgressValue = "thread.run.step.in_progress"; - private const string ThreadRunStepDeltaValue = "thread.run.step.delta"; - private const string ThreadRunStepCompletedValue = "thread.run.step.completed"; - private const string ThreadRunStepFailedValue = "thread.run.step.failed"; - private const string ThreadRunStepCancelledValue = "thread.run.step.cancelled"; - private const string ThreadRunStepExpiredValue = "thread.run.step.expired"; - private const string ThreadMessageCreatedValue = "thread.message.created"; - private const string ThreadMessageInProgressValue = "thread.message.in_progress"; - private const string ThreadMessageDeltaValue = "thread.message.delta"; - private const string ThreadMessageCompletedValue = "thread.message.completed"; - private const string ThreadMessageIncompleteValue = "thread.message.incomplete"; - private const string ErrorValue = "error"; - private const string DoneValue = "done"; - - /// Event sent when a new thread is created. The data of this event is of type AgentThread. - public static AgentStreamEvent ThreadCreated { get; } = new AgentStreamEvent(ThreadCreatedValue); - /// Event sent when a new run is created. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunCreated { get; } = new AgentStreamEvent(ThreadRunCreatedValue); - /// Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunQueued { get; } = new AgentStreamEvent(ThreadRunQueuedValue); - /// Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunInProgress { get; } = new AgentStreamEvent(ThreadRunInProgressValue); - /// Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunRequiresAction { get; } = new AgentStreamEvent(ThreadRunRequiresActionValue); - /// Event sent when a run is completed. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunCompleted { get; } = new AgentStreamEvent(ThreadRunCompletedValue); - /// Event sent when a run ends incomplete. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunIncomplete { get; } = new AgentStreamEvent(ThreadRunIncompleteValue); - /// Event sent when a run fails. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunFailed { get; } = new AgentStreamEvent(ThreadRunFailedValue); - /// Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunCancelling { get; } = new AgentStreamEvent(ThreadRunCancellingValue); - /// Event sent when a run is cancelled. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunCancelled { get; } = new AgentStreamEvent(ThreadRunCancelledValue); - /// Event sent when a run is expired. The data of this event is of type ThreadRun. - public static AgentStreamEvent ThreadRunExpired { get; } = new AgentStreamEvent(ThreadRunExpiredValue); - /// Event sent when a new thread run step is created. The data of this event is of type RunStep. - public static AgentStreamEvent ThreadRunStepCreated { get; } = new AgentStreamEvent(ThreadRunStepCreatedValue); - /// Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep. - public static AgentStreamEvent ThreadRunStepInProgress { get; } = new AgentStreamEvent(ThreadRunStepInProgressValue); - /// Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk. - public static AgentStreamEvent ThreadRunStepDelta { get; } = new AgentStreamEvent(ThreadRunStepDeltaValue); - /// Event sent when a run step is completed. The data of this event is of type RunStep. - public static AgentStreamEvent ThreadRunStepCompleted { get; } = new AgentStreamEvent(ThreadRunStepCompletedValue); - /// Event sent when a run step fails. The data of this event is of type RunStep. - public static AgentStreamEvent ThreadRunStepFailed { get; } = new AgentStreamEvent(ThreadRunStepFailedValue); - /// Event sent when a run step is cancelled. The data of this event is of type RunStep. - public static AgentStreamEvent ThreadRunStepCancelled { get; } = new AgentStreamEvent(ThreadRunStepCancelledValue); - /// Event sent when a run step is expired. The data of this event is of type RunStep. - public static AgentStreamEvent ThreadRunStepExpired { get; } = new AgentStreamEvent(ThreadRunStepExpiredValue); - /// Event sent when a new message is created. The data of this event is of type ThreadMessage. - public static AgentStreamEvent ThreadMessageCreated { get; } = new AgentStreamEvent(ThreadMessageCreatedValue); - /// Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage. - public static AgentStreamEvent ThreadMessageInProgress { get; } = new AgentStreamEvent(ThreadMessageInProgressValue); - /// Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk. - public static AgentStreamEvent ThreadMessageDelta { get; } = new AgentStreamEvent(ThreadMessageDeltaValue); - /// Event sent when a message is completed. The data of this event is of type ThreadMessage. - public static AgentStreamEvent ThreadMessageCompleted { get; } = new AgentStreamEvent(ThreadMessageCompletedValue); - /// Event sent before a message is completed. The data of this event is of type ThreadMessage. - public static AgentStreamEvent ThreadMessageIncomplete { get; } = new AgentStreamEvent(ThreadMessageIncompleteValue); - /// Event sent when an error occurs, such as an internal server error or a timeout. - public static AgentStreamEvent Error { get; } = new AgentStreamEvent(ErrorValue); - /// Event sent when the stream is done. - public static AgentStreamEvent Done { get; } = new AgentStreamEvent(DoneValue); - /// Determines if two values are the same. - public static bool operator ==(AgentStreamEvent left, AgentStreamEvent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AgentStreamEvent left, AgentStreamEvent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator AgentStreamEvent(string value) => new AgentStreamEvent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AgentStreamEvent other && Equals(other); - /// - public bool Equals(AgentStreamEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/DoneEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/DoneEvent.cs deleted file mode 100644 index 9f658de4258c7..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/DoneEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// Terminal event indicating the successful end of a stream. - public readonly partial struct DoneEvent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DoneEvent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DoneValue = "done"; - - /// Event sent when the stream is done. - public static DoneEvent Done { get; } = new DoneEvent(DoneValue); - /// Determines if two values are the same. - public static bool operator ==(DoneEvent left, DoneEvent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DoneEvent left, DoneEvent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator DoneEvent(string value) => new DoneEvent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DoneEvent other && Equals(other); - /// - public bool Equals(DoneEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ErrorEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ErrorEvent.cs deleted file mode 100644 index ea570033f684a..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ErrorEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// Terminal event indicating a server side error while streaming. - public readonly partial struct ErrorEvent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ErrorEvent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ErrorValue = "error"; - - /// Event sent when an error occurs, such as an internal server error or a timeout. - public static ErrorEvent Error { get; } = new ErrorEvent(ErrorValue); - /// Determines if two values are the same. - public static bool operator ==(ErrorEvent left, ErrorEvent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ErrorEvent left, ErrorEvent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ErrorEvent(string value) => new ErrorEvent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ErrorEvent other && Equals(other); - /// - public bool Equals(ErrorEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.Serialization.cs deleted file mode 100644 index 2131a64f0c1c6..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.Serialization.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDelta : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDelta)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("role"u8); - writer.WriteStringValue(Role.ToString()); - writer.WritePropertyName("content"u8); - writer.WriteStartArray(); - foreach (var item in Content) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDelta IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDelta)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDelta(document.RootElement, options); - } - - internal static MessageDelta DeserializeMessageDelta(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MessageRole role = default; - IReadOnlyList content = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("role"u8)) - { - role = new MessageRole(property.Value.GetString()); - continue; - } - if (property.NameEquals("content"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MessageDeltaContent.DeserializeMessageDeltaContent(item, options)); - } - content = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDelta(role, content, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDelta)} does not support writing '{options.Format}' format."); - } - } - - MessageDelta IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDelta(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDelta)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDelta FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDelta(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.cs deleted file mode 100644 index 764571c6aa112..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDelta.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.Projects -{ - /// Represents the typed 'delta' payload within a streaming message delta chunk. - public partial class MessageDelta - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The entity that produced the message. - /// - /// The content of the message as an array of text and/or images. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// is null. - internal MessageDelta(MessageRole role, IEnumerable content) - { - Argument.AssertNotNull(content, nameof(content)); - - Role = role; - Content = content.ToList(); - } - - /// Initializes a new instance of . - /// The entity that produced the message. - /// - /// The content of the message as an array of text and/or images. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// Keeps track of any properties unknown to the library. - internal MessageDelta(MessageRole role, IReadOnlyList content, IDictionary serializedAdditionalRawData) - { - Role = role; - Content = content; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MessageDelta() - { - } - - /// The entity that produced the message. - public MessageRole Role { get; } - /// - /// The content of the message as an array of text and/or images. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public IReadOnlyList Content { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.Serialization.cs deleted file mode 100644 index b672132912cc3..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.Serialization.cs +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaChunk : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaChunk)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("object"u8); - writer.WriteStringValue(Object.ToString()); - writer.WritePropertyName("delta"u8); - writer.WriteObjectValue(Delta, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDeltaChunk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaChunk)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaChunk(document.RootElement, options); - } - - internal static MessageDeltaChunk DeserializeMessageDeltaChunk(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - MessageDeltaChunkObject @object = default; - MessageDelta delta = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("object"u8)) - { - @object = new MessageDeltaChunkObject(property.Value.GetString()); - continue; - } - if (property.NameEquals("delta"u8)) - { - delta = MessageDelta.DeserializeMessageDelta(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaChunk(id, @object, delta, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaChunk)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaChunk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaChunk(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaChunk)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDeltaChunk FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaChunk(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.cs deleted file mode 100644 index cf40d797394f5..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunk.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a message delta i.e. any changed fields on a message during streaming. - public partial class MessageDeltaChunk - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The identifier of the message, which can be referenced in API endpoints. - /// The delta containing the fields that have changed on the Message. - /// or is null. - internal MessageDeltaChunk(string id, MessageDelta delta) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(delta, nameof(delta)); - - Id = id; - Delta = delta; - } - - /// Initializes a new instance of . - /// The identifier of the message, which can be referenced in API endpoints. - /// The object type, which is always `thread.message.delta`. - /// The delta containing the fields that have changed on the Message. - /// Keeps track of any properties unknown to the library. - internal MessageDeltaChunk(string id, MessageDeltaChunkObject @object, MessageDelta delta, IDictionary serializedAdditionalRawData) - { - Id = id; - Object = @object; - Delta = delta; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MessageDeltaChunk() - { - } - - /// The identifier of the message, which can be referenced in API endpoints. - public string Id { get; } - /// The object type, which is always `thread.message.delta`. - public MessageDeltaChunkObject Object { get; } = MessageDeltaChunkObject.ThreadMessageDelta; - - /// The delta containing the fields that have changed on the Message. - public MessageDelta Delta { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunkObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunkObject.cs deleted file mode 100644 index d21c2b7731b40..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaChunkObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// The MessageDeltaChunk_object. - public readonly partial struct MessageDeltaChunkObject : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MessageDeltaChunkObject(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadMessageDeltaValue = "thread.message.delta"; - - /// thread.message.delta. - public static MessageDeltaChunkObject ThreadMessageDelta { get; } = new MessageDeltaChunkObject(ThreadMessageDeltaValue); - /// Determines if two values are the same. - public static bool operator ==(MessageDeltaChunkObject left, MessageDeltaChunkObject right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MessageDeltaChunkObject left, MessageDeltaChunkObject right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator MessageDeltaChunkObject(string value) => new MessageDeltaChunkObject(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MessageDeltaChunkObject other && Equals(other); - /// - public bool Equals(MessageDeltaChunkObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.Serialization.cs deleted file mode 100644 index 86bc3e76c4a9d..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - [PersistableModelProxy(typeof(UnknownMessageDeltaContent))] - public partial class MessageDeltaContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("index"u8); - writer.WriteNumberValue(Index); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDeltaContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaContent(document.RootElement, options); - } - - internal static MessageDeltaContent DeserializeMessageDeltaContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "image_file": return MessageDeltaImageFileContent.DeserializeMessageDeltaImageFileContent(element, options); - case "text": return MessageDeltaTextContent.DeserializeMessageDeltaTextContent(element, options); - } - } - return UnknownMessageDeltaContent.DeserializeUnknownMessageDeltaContent(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDeltaContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaContent(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.cs deleted file mode 100644 index 367980dcb8a0e..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaContent.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// - /// The abstract base representation of a partial streamed message content payload. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class MessageDeltaContent - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The index of the content part of the message. - protected MessageDeltaContent(int index) - { - Index = index; - } - - /// Initializes a new instance of . - /// The index of the content part of the message. - /// The type of content for this content part. - /// Keeps track of any properties unknown to the library. - internal MessageDeltaContent(int index, string type, IDictionary serializedAdditionalRawData) - { - Index = index; - Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MessageDeltaContent() - { - } - - /// The index of the content part of the message. - public int Index { get; } - /// The type of content for this content part. - internal string Type { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.Serialization.cs deleted file mode 100644 index 80ef6edf733c4..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaImageFileContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaImageFileContent)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(ImageFile)) - { - writer.WritePropertyName("image_file"u8); - writer.WriteObjectValue(ImageFile, options); - } - } - - MessageDeltaImageFileContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaImageFileContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaImageFileContent(document.RootElement, options); - } - - internal static MessageDeltaImageFileContent DeserializeMessageDeltaImageFileContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MessageDeltaImageFileContentObject imageFile = default; - int index = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("image_file"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - imageFile = MessageDeltaImageFileContentObject.DeserializeMessageDeltaImageFileContentObject(property.Value, options); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaImageFileContent(index, type, serializedAdditionalRawData, imageFile); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaImageFileContent)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaImageFileContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaImageFileContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaImageFileContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MessageDeltaImageFileContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaImageFileContent(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.cs deleted file mode 100644 index 782ee27b4b558..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContent.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a streamed image file content part within a streaming message delta chunk. - public partial class MessageDeltaImageFileContent : MessageDeltaContent - { - /// Initializes a new instance of . - /// The index of the content part of the message. - internal MessageDeltaImageFileContent(int index) : base(index) - { - Type = "image_file"; - } - - /// Initializes a new instance of . - /// The index of the content part of the message. - /// The type of content for this content part. - /// Keeps track of any properties unknown to the library. - /// The image_file data. - internal MessageDeltaImageFileContent(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaImageFileContentObject imageFile) : base(index, type, serializedAdditionalRawData) - { - ImageFile = imageFile; - } - - /// Initializes a new instance of for deserialization. - internal MessageDeltaImageFileContent() - { - } - - /// The image_file data. - public MessageDeltaImageFileContentObject ImageFile { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.Serialization.cs deleted file mode 100644 index 0772f9b9743f9..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.Serialization.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaImageFileContentObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaImageFileContentObject)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(FileId)) - { - writer.WritePropertyName("file_id"u8); - writer.WriteStringValue(FileId); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDeltaImageFileContentObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaImageFileContentObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaImageFileContentObject(document.RootElement, options); - } - - internal static MessageDeltaImageFileContentObject DeserializeMessageDeltaImageFileContentObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string fileId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_id"u8)) - { - fileId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaImageFileContentObject(fileId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaImageFileContentObject)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaImageFileContentObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaImageFileContentObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaImageFileContentObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDeltaImageFileContentObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaImageFileContentObject(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.cs deleted file mode 100644 index e62ccc339207e..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaImageFileContentObject.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the 'image_file' payload within streaming image file content. - public partial class MessageDeltaImageFileContentObject - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal MessageDeltaImageFileContentObject() - { - } - - /// Initializes a new instance of . - /// The file ID of the image in the message content. - /// Keeps track of any properties unknown to the library. - internal MessageDeltaImageFileContentObject(string fileId, IDictionary serializedAdditionalRawData) - { - FileId = fileId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The file ID of the image in the message content. - public string FileId { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs deleted file mode 100644 index 3b315583ceb77..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - [PersistableModelProxy(typeof(UnknownMessageDeltaTextAnnotation))] - public partial class MessageDeltaTextAnnotation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("index"u8); - writer.WriteNumberValue(Index); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDeltaTextAnnotation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextAnnotation(document.RootElement, options); - } - - internal static MessageDeltaTextAnnotation DeserializeMessageDeltaTextAnnotation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "file_citation": return MessageDeltaTextFileCitationAnnotation.DeserializeMessageDeltaTextFileCitationAnnotation(element, options); - case "file_path": return MessageDeltaTextFilePathAnnotation.DeserializeMessageDeltaTextFilePathAnnotation(element, options); - } - } - return UnknownMessageDeltaTextAnnotation.DeserializeUnknownMessageDeltaTextAnnotation(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextAnnotation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDeltaTextAnnotation FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaTextAnnotation(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs deleted file mode 100644 index a283e7754283d..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextAnnotation.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// - /// The abstract base representation of a streamed text content part's text annotation. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class MessageDeltaTextAnnotation - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - protected MessageDeltaTextAnnotation(int index) - { - Index = index; - } - - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - /// The type of the text content annotation. - /// Keeps track of any properties unknown to the library. - internal MessageDeltaTextAnnotation(int index, string type, IDictionary serializedAdditionalRawData) - { - Index = index; - Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MessageDeltaTextAnnotation() - { - } - - /// The index of the annotation within a text content part. - public int Index { get; } - /// The type of the text content annotation. - internal string Type { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.Serialization.cs deleted file mode 100644 index f3dbe17210d1b..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaTextContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextContent)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Text)) - { - writer.WritePropertyName("text"u8); - writer.WriteObjectValue(Text, options); - } - } - - MessageDeltaTextContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextContent(document.RootElement, options); - } - - internal static MessageDeltaTextContent DeserializeMessageDeltaTextContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MessageDeltaTextContentObject text = default; - int index = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("text"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - text = MessageDeltaTextContentObject.DeserializeMessageDeltaTextContentObject(property.Value, options); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextContent(index, type, serializedAdditionalRawData, text); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextContent)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MessageDeltaTextContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaTextContent(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.cs deleted file mode 100644 index af3ed70f6d9c5..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContent.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a streamed text content part within a streaming message delta chunk. - public partial class MessageDeltaTextContent : MessageDeltaContent - { - /// Initializes a new instance of . - /// The index of the content part of the message. - internal MessageDeltaTextContent(int index) : base(index) - { - Type = "text"; - } - - /// Initializes a new instance of . - /// The index of the content part of the message. - /// The type of content for this content part. - /// Keeps track of any properties unknown to the library. - /// The text content details. - internal MessageDeltaTextContent(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextContentObject text) : base(index, type, serializedAdditionalRawData) - { - Text = text; - } - - /// Initializes a new instance of for deserialization. - internal MessageDeltaTextContent() - { - } - - /// The text content details. - public MessageDeltaTextContentObject Text { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs deleted file mode 100644 index 4604c724436c0..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaTextContentObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStringValue(Value); - } - if (Optional.IsCollectionDefined(Annotations)) - { - writer.WritePropertyName("annotations"u8); - writer.WriteStartArray(); - foreach (var item in Annotations) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDeltaTextContentObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextContentObject(document.RootElement, options); - } - - internal static MessageDeltaTextContentObject DeserializeMessageDeltaTextContentObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string value = default; - IReadOnlyList annotations = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - value = property.Value.GetString(); - continue; - } - if (property.NameEquals("annotations"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MessageDeltaTextAnnotation.DeserializeMessageDeltaTextAnnotation(item, options)); - } - annotations = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextContentObject(value, annotations ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextContentObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextContentObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDeltaTextContentObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaTextContentObject(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs deleted file mode 100644 index c7965b213a24f..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the data of a streamed text content part within a streaming message delta chunk. - public partial class MessageDeltaTextContentObject - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal MessageDeltaTextContentObject() - { - Annotations = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The data that makes up the text. - /// - /// Annotations for the text. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// Keeps track of any properties unknown to the library. - internal MessageDeltaTextContentObject(string value, IReadOnlyList annotations, IDictionary serializedAdditionalRawData) - { - Value = value; - Annotations = annotations; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The data that makes up the text. - public string Value { get; } - /// - /// Annotations for the text. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public IReadOnlyList Annotations { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.Serialization.cs deleted file mode 100644 index d7a6b18301d14..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.Serialization.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaTextFileCitationAnnotation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotation)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(FileCitation)) - { - writer.WritePropertyName("file_citation"u8); - writer.WriteObjectValue(FileCitation, options); - } - if (Optional.IsDefined(Text)) - { - writer.WritePropertyName("text"u8); - writer.WriteStringValue(Text); - } - if (Optional.IsDefined(StartIndex)) - { - writer.WritePropertyName("start_index"u8); - writer.WriteNumberValue(StartIndex.Value); - } - if (Optional.IsDefined(EndIndex)) - { - writer.WritePropertyName("end_index"u8); - writer.WriteNumberValue(EndIndex.Value); - } - } - - MessageDeltaTextFileCitationAnnotation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextFileCitationAnnotation(document.RootElement, options); - } - - internal static MessageDeltaTextFileCitationAnnotation DeserializeMessageDeltaTextFileCitationAnnotation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MessageDeltaTextFileCitationAnnotationObject fileCitation = default; - string text = default; - int? startIndex = default; - int? endIndex = default; - int index = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_citation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - fileCitation = MessageDeltaTextFileCitationAnnotationObject.DeserializeMessageDeltaTextFileCitationAnnotationObject(property.Value, options); - continue; - } - if (property.NameEquals("text"u8)) - { - text = property.Value.GetString(); - continue; - } - if (property.NameEquals("start_index"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - startIndex = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("end_index"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endIndex = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextFileCitationAnnotation( - index, - type, - serializedAdditionalRawData, - fileCitation, - text, - startIndex, - endIndex); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotation)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextFileCitationAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextFileCitationAnnotation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MessageDeltaTextFileCitationAnnotation FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaTextFileCitationAnnotation(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.cs deleted file mode 100644 index f22164e3a330b..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotation.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a streamed file citation applied to a streaming text content part. - public partial class MessageDeltaTextFileCitationAnnotation : MessageDeltaTextAnnotation - { - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - internal MessageDeltaTextFileCitationAnnotation(int index) : base(index) - { - Type = "file_citation"; - } - - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - /// The type of the text content annotation. - /// Keeps track of any properties unknown to the library. - /// The file citation information. - /// The text in the message content that needs to be replaced. - /// The start index of this annotation in the content text. - /// The end index of this annotation in the content text. - internal MessageDeltaTextFileCitationAnnotation(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextFileCitationAnnotationObject fileCitation, string text, int? startIndex, int? endIndex) : base(index, type, serializedAdditionalRawData) - { - FileCitation = fileCitation; - Text = text; - StartIndex = startIndex; - EndIndex = endIndex; - } - - /// Initializes a new instance of for deserialization. - internal MessageDeltaTextFileCitationAnnotation() - { - } - - /// The file citation information. - public MessageDeltaTextFileCitationAnnotationObject FileCitation { get; } - /// The text in the message content that needs to be replaced. - public string Text { get; } - /// The start index of this annotation in the content text. - public int? StartIndex { get; } - /// The end index of this annotation in the content text. - public int? EndIndex { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.Serialization.cs deleted file mode 100644 index a82c41d59813a..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.Serialization.cs +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaTextFileCitationAnnotationObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotationObject)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(FileId)) - { - writer.WritePropertyName("file_id"u8); - writer.WriteStringValue(FileId); - } - if (Optional.IsDefined(Quote)) - { - writer.WritePropertyName("quote"u8); - writer.WriteStringValue(Quote); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDeltaTextFileCitationAnnotationObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotationObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextFileCitationAnnotationObject(document.RootElement, options); - } - - internal static MessageDeltaTextFileCitationAnnotationObject DeserializeMessageDeltaTextFileCitationAnnotationObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string fileId = default; - string quote = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_id"u8)) - { - fileId = property.Value.GetString(); - continue; - } - if (property.NameEquals("quote"u8)) - { - quote = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextFileCitationAnnotationObject(fileId, quote, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotationObject)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextFileCitationAnnotationObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextFileCitationAnnotationObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFileCitationAnnotationObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDeltaTextFileCitationAnnotationObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaTextFileCitationAnnotationObject(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.cs deleted file mode 100644 index ef326afe631bc..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFileCitationAnnotationObject.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the data of a streamed file citation as applied to a streaming text content part. - public partial class MessageDeltaTextFileCitationAnnotationObject - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal MessageDeltaTextFileCitationAnnotationObject() - { - } - - /// Initializes a new instance of . - /// The ID of the specific file the citation is from. - /// The specific quote in the cited file. - /// Keeps track of any properties unknown to the library. - internal MessageDeltaTextFileCitationAnnotationObject(string fileId, string quote, IDictionary serializedAdditionalRawData) - { - FileId = fileId; - Quote = quote; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The ID of the specific file the citation is from. - public string FileId { get; } - /// The specific quote in the cited file. - public string Quote { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.Serialization.cs deleted file mode 100644 index c6258fb194864..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.Serialization.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaTextFilePathAnnotation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotation)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(FilePath)) - { - writer.WritePropertyName("file_path"u8); - writer.WriteObjectValue(FilePath, options); - } - if (Optional.IsDefined(StartIndex)) - { - writer.WritePropertyName("start_index"u8); - writer.WriteNumberValue(StartIndex.Value); - } - if (Optional.IsDefined(EndIndex)) - { - writer.WritePropertyName("end_index"u8); - writer.WriteNumberValue(EndIndex.Value); - } - if (Optional.IsDefined(Text)) - { - writer.WritePropertyName("text"u8); - writer.WriteStringValue(Text); - } - } - - MessageDeltaTextFilePathAnnotation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextFilePathAnnotation(document.RootElement, options); - } - - internal static MessageDeltaTextFilePathAnnotation DeserializeMessageDeltaTextFilePathAnnotation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - MessageDeltaTextFilePathAnnotationObject filePath = default; - int? startIndex = default; - int? endIndex = default; - string text = default; - int index = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_path"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - filePath = MessageDeltaTextFilePathAnnotationObject.DeserializeMessageDeltaTextFilePathAnnotationObject(property.Value, options); - continue; - } - if (property.NameEquals("start_index"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - startIndex = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("end_index"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endIndex = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("text"u8)) - { - text = property.Value.GetString(); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextFilePathAnnotation( - index, - type, - serializedAdditionalRawData, - filePath, - startIndex, - endIndex, - text); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotation)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextFilePathAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextFilePathAnnotation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new MessageDeltaTextFilePathAnnotation FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaTextFilePathAnnotation(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.cs deleted file mode 100644 index 90bf54d5059b2..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotation.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a streamed file path annotation applied to a streaming text content part. - public partial class MessageDeltaTextFilePathAnnotation : MessageDeltaTextAnnotation - { - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - internal MessageDeltaTextFilePathAnnotation(int index) : base(index) - { - Type = "file_path"; - } - - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - /// The type of the text content annotation. - /// Keeps track of any properties unknown to the library. - /// The file path information. - /// The start index of this annotation in the content text. - /// The end index of this annotation in the content text. - /// The text in the message content that needs to be replaced. - internal MessageDeltaTextFilePathAnnotation(int index, string type, IDictionary serializedAdditionalRawData, MessageDeltaTextFilePathAnnotationObject filePath, int? startIndex, int? endIndex, string text) : base(index, type, serializedAdditionalRawData) - { - FilePath = filePath; - StartIndex = startIndex; - EndIndex = endIndex; - Text = text; - } - - /// Initializes a new instance of for deserialization. - internal MessageDeltaTextFilePathAnnotation() - { - } - - /// The file path information. - public MessageDeltaTextFilePathAnnotationObject FilePath { get; } - /// The start index of this annotation in the content text. - public int? StartIndex { get; } - /// The end index of this annotation in the content text. - public int? EndIndex { get; } - /// The text in the message content that needs to be replaced. - public string Text { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.Serialization.cs deleted file mode 100644 index 76ebcc5ed6237..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.Serialization.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class MessageDeltaTextFilePathAnnotationObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotationObject)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(FileId)) - { - writer.WritePropertyName("file_id"u8); - writer.WriteStringValue(FileId); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MessageDeltaTextFilePathAnnotationObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotationObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextFilePathAnnotationObject(document.RootElement, options); - } - - internal static MessageDeltaTextFilePathAnnotationObject DeserializeMessageDeltaTextFilePathAnnotationObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string fileId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_id"u8)) - { - fileId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MessageDeltaTextFilePathAnnotationObject(fileId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotationObject)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextFilePathAnnotationObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextFilePathAnnotationObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextFilePathAnnotationObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static MessageDeltaTextFilePathAnnotationObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeMessageDeltaTextFilePathAnnotationObject(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.cs deleted file mode 100644 index 0bc0e8a005175..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextFilePathAnnotationObject.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the data of a streamed file path annotation as applied to a streaming text content part. - public partial class MessageDeltaTextFilePathAnnotationObject - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal MessageDeltaTextFilePathAnnotationObject() - { - } - - /// Initializes a new instance of . - /// The file ID for the annotation. - /// Keeps track of any properties unknown to the library. - internal MessageDeltaTextFilePathAnnotationObject(string fileId, IDictionary serializedAdditionalRawData) - { - FileId = fileId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The file ID for the annotation. - public string FileId { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/MessageStreamEvent.cs deleted file mode 100644 index 333c12b43a3f3..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageStreamEvent.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// Message operation related streaming events. - public readonly partial struct MessageStreamEvent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public MessageStreamEvent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadMessageCreatedValue = "thread.message.created"; - private const string ThreadMessageInProgressValue = "thread.message.in_progress"; - private const string ThreadMessageDeltaValue = "thread.message.delta"; - private const string ThreadMessageCompletedValue = "thread.message.completed"; - private const string ThreadMessageIncompleteValue = "thread.message.incomplete"; - - /// Event sent when a new message is created. The data of this event is of type ThreadMessage. - public static MessageStreamEvent ThreadMessageCreated { get; } = new MessageStreamEvent(ThreadMessageCreatedValue); - /// Event sent when a message moves to `in_progress` status. The data of this event is of type ThreadMessage. - public static MessageStreamEvent ThreadMessageInProgress { get; } = new MessageStreamEvent(ThreadMessageInProgressValue); - /// Event sent when a message is being streamed. The data of this event is of type MessageDeltaChunk. - public static MessageStreamEvent ThreadMessageDelta { get; } = new MessageStreamEvent(ThreadMessageDeltaValue); - /// Event sent when a message is completed. The data of this event is of type ThreadMessage. - public static MessageStreamEvent ThreadMessageCompleted { get; } = new MessageStreamEvent(ThreadMessageCompletedValue); - /// Event sent before a message is completed. The data of this event is of type ThreadMessage. - public static MessageStreamEvent ThreadMessageIncomplete { get; } = new MessageStreamEvent(ThreadMessageIncompleteValue); - /// Determines if two values are the same. - public static bool operator ==(MessageStreamEvent left, MessageStreamEvent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(MessageStreamEvent left, MessageStreamEvent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator MessageStreamEvent(string value) => new MessageStreamEvent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is MessageStreamEvent other && Equals(other); - /// - public bool Equals(MessageStreamEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.Serialization.cs deleted file mode 100644 index 41df1f3c90b75..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.Serialization.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDelta : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDelta)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(StepDetails)) - { - writer.WritePropertyName("step_details"u8); - writer.WriteObjectValue(StepDetails, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDelta IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDelta)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDelta(document.RootElement, options); - } - - internal static RunStepDelta DeserializeRunStepDelta(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - RunStepDeltaDetail stepDetails = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("step_details"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - stepDetails = RunStepDeltaDetail.DeserializeRunStepDeltaDetail(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDelta(stepDetails, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDelta)} does not support writing '{options.Format}' format."); - } - } - - RunStepDelta IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDelta(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDelta)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDelta FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDelta(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.cs deleted file mode 100644 index 0f601698841df..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDelta.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the delta payload in a streaming run step delta chunk. - public partial class RunStepDelta - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal RunStepDelta() - { - } - - /// Initializes a new instance of . - /// - /// The details of the run step. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// Keeps track of any properties unknown to the library. - internal RunStepDelta(RunStepDeltaDetail stepDetails, IDictionary serializedAdditionalRawData) - { - StepDetails = stepDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// - /// The details of the run step. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public RunStepDeltaDetail StepDetails { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.Serialization.cs deleted file mode 100644 index bd86667370fcc..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.Serialization.cs +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaChunk : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaChunk)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("object"u8); - writer.WriteStringValue(Object.ToString()); - writer.WritePropertyName("delta"u8); - writer.WriteObjectValue(Delta, options); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaChunk IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaChunk)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaChunk(document.RootElement, options); - } - - internal static RunStepDeltaChunk DeserializeRunStepDeltaChunk(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - RunStepDeltaChunkObject @object = default; - RunStepDelta delta = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("object"u8)) - { - @object = new RunStepDeltaChunkObject(property.Value.GetString()); - continue; - } - if (property.NameEquals("delta"u8)) - { - delta = RunStepDelta.DeserializeRunStepDelta(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaChunk(id, @object, delta, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaChunk)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaChunk IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaChunk(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaChunk)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaChunk FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaChunk(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.cs deleted file mode 100644 index bd48db51e72c1..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunk.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a run step delta i.e. any changed fields on a run step during streaming. - public partial class RunStepDeltaChunk - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The identifier of the run step, which can be referenced in API endpoints. - /// The delta containing the fields that have changed on the run step. - /// or is null. - internal RunStepDeltaChunk(string id, RunStepDelta delta) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(delta, nameof(delta)); - - Id = id; - Delta = delta; - } - - /// Initializes a new instance of . - /// The identifier of the run step, which can be referenced in API endpoints. - /// The object type, which is always `thread.run.step.delta`. - /// The delta containing the fields that have changed on the run step. - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaChunk(string id, RunStepDeltaChunkObject @object, RunStepDelta delta, IDictionary serializedAdditionalRawData) - { - Id = id; - Object = @object; - Delta = delta; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaChunk() - { - } - - /// The identifier of the run step, which can be referenced in API endpoints. - public string Id { get; } - /// The object type, which is always `thread.run.step.delta`. - public RunStepDeltaChunkObject Object { get; } = RunStepDeltaChunkObject.ThreadRunStepDelta; - - /// The delta containing the fields that have changed on the run step. - public RunStepDelta Delta { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunkObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunkObject.cs deleted file mode 100644 index 3f217f5436611..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaChunkObject.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// The RunStepDeltaChunk_object. - public readonly partial struct RunStepDeltaChunkObject : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RunStepDeltaChunkObject(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadRunStepDeltaValue = "thread.run.step.delta"; - - /// thread.run.step.delta. - public static RunStepDeltaChunkObject ThreadRunStepDelta { get; } = new RunStepDeltaChunkObject(ThreadRunStepDeltaValue); - /// Determines if two values are the same. - public static bool operator ==(RunStepDeltaChunkObject left, RunStepDeltaChunkObject right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RunStepDeltaChunkObject left, RunStepDeltaChunkObject right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator RunStepDeltaChunkObject(string value) => new RunStepDeltaChunkObject(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RunStepDeltaChunkObject other && Equals(other); - /// - public bool Equals(RunStepDeltaChunkObject other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.Serialization.cs deleted file mode 100644 index 2d242dc345aab..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.Serialization.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaCodeInterpreterDetailItemObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterDetailItemObject)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Input)) - { - writer.WritePropertyName("input"u8); - writer.WriteStringValue(Input); - } - if (Optional.IsCollectionDefined(Outputs)) - { - writer.WritePropertyName("outputs"u8); - writer.WriteStartArray(); - foreach (var item in Outputs) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaCodeInterpreterDetailItemObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterDetailItemObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaCodeInterpreterDetailItemObject(document.RootElement, options); - } - - internal static RunStepDeltaCodeInterpreterDetailItemObject DeserializeRunStepDeltaCodeInterpreterDetailItemObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string input = default; - IReadOnlyList outputs = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("input"u8)) - { - input = property.Value.GetString(); - continue; - } - if (property.NameEquals("outputs"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RunStepDeltaCodeInterpreterOutput.DeserializeRunStepDeltaCodeInterpreterOutput(item, options)); - } - outputs = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaCodeInterpreterDetailItemObject(input, outputs ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterDetailItemObject)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaCodeInterpreterDetailItemObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaCodeInterpreterDetailItemObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterDetailItemObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaCodeInterpreterDetailItemObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaCodeInterpreterDetailItemObject(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.cs deleted file mode 100644 index a76ab9ec7a094..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterDetailItemObject.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the Code Interpreter tool call data in a streaming run step's tool calls. - public partial class RunStepDeltaCodeInterpreterDetailItemObject - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal RunStepDeltaCodeInterpreterDetailItemObject() - { - Outputs = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The input into the Code Interpreter tool call. - /// - /// The outputs from the Code Interpreter tool call. Code Interpreter can output one or more - /// items, including text (`logs`) or images (`image`). Each of these are represented by a - /// different object type. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaCodeInterpreterDetailItemObject(string input, IReadOnlyList outputs, IDictionary serializedAdditionalRawData) - { - Input = input; - Outputs = outputs; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The input into the Code Interpreter tool call. - public string Input { get; } - /// - /// The outputs from the Code Interpreter tool call. Code Interpreter can output one or more - /// items, including text (`logs`) or images (`image`). Each of these are represented by a - /// different object type. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public IReadOnlyList Outputs { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.Serialization.cs deleted file mode 100644 index 338949150f43d..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.Serialization.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaCodeInterpreterImageOutput : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutput)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Image)) - { - writer.WritePropertyName("image"u8); - writer.WriteObjectValue(Image, options); - } - } - - RunStepDeltaCodeInterpreterImageOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutput)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaCodeInterpreterImageOutput(document.RootElement, options); - } - - internal static RunStepDeltaCodeInterpreterImageOutput DeserializeRunStepDeltaCodeInterpreterImageOutput(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - RunStepDeltaCodeInterpreterImageOutputObject image = default; - int index = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("image"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - image = RunStepDeltaCodeInterpreterImageOutputObject.DeserializeRunStepDeltaCodeInterpreterImageOutputObject(property.Value, options); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaCodeInterpreterImageOutput(index, type, serializedAdditionalRawData, image); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutput)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaCodeInterpreterImageOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaCodeInterpreterImageOutput(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutput)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepDeltaCodeInterpreterImageOutput FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaCodeInterpreterImageOutput(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.cs deleted file mode 100644 index de128c6b86884..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutput.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents an image output as produced the Code interpreter tool and as represented in a streaming run step's delta tool calls collection. - public partial class RunStepDeltaCodeInterpreterImageOutput : RunStepDeltaCodeInterpreterOutput - { - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - internal RunStepDeltaCodeInterpreterImageOutput(int index) : base(index) - { - Type = "image"; - } - - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - /// The type of the streaming run step tool call's Code Interpreter output. - /// Keeps track of any properties unknown to the library. - /// The image data for the Code Interpreter tool call output. - internal RunStepDeltaCodeInterpreterImageOutput(int index, string type, IDictionary serializedAdditionalRawData, RunStepDeltaCodeInterpreterImageOutputObject image) : base(index, type, serializedAdditionalRawData) - { - Image = image; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaCodeInterpreterImageOutput() - { - } - - /// The image data for the Code Interpreter tool call output. - public RunStepDeltaCodeInterpreterImageOutputObject Image { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.Serialization.cs deleted file mode 100644 index ede94b51ecb9a..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.Serialization.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaCodeInterpreterImageOutputObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutputObject)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(FileId)) - { - writer.WritePropertyName("file_id"u8); - writer.WriteStringValue(FileId); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaCodeInterpreterImageOutputObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutputObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaCodeInterpreterImageOutputObject(document.RootElement, options); - } - - internal static RunStepDeltaCodeInterpreterImageOutputObject DeserializeRunStepDeltaCodeInterpreterImageOutputObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string fileId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_id"u8)) - { - fileId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaCodeInterpreterImageOutputObject(fileId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutputObject)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaCodeInterpreterImageOutputObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaCodeInterpreterImageOutputObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterImageOutputObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaCodeInterpreterImageOutputObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaCodeInterpreterImageOutputObject(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.cs deleted file mode 100644 index 8089067be9d74..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterImageOutputObject.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the data for a streaming run step's Code Interpreter tool call image output. - public partial class RunStepDeltaCodeInterpreterImageOutputObject - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal RunStepDeltaCodeInterpreterImageOutputObject() - { - } - - /// Initializes a new instance of . - /// The file ID for the image. - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaCodeInterpreterImageOutputObject(string fileId, IDictionary serializedAdditionalRawData) - { - FileId = fileId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The file ID for the image. - public string FileId { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.Serialization.cs deleted file mode 100644 index f280d68e3eb77..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.Serialization.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaCodeInterpreterLogOutput : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterLogOutput)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Logs)) - { - writer.WritePropertyName("logs"u8); - writer.WriteStringValue(Logs); - } - } - - RunStepDeltaCodeInterpreterLogOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterLogOutput)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaCodeInterpreterLogOutput(document.RootElement, options); - } - - internal static RunStepDeltaCodeInterpreterLogOutput DeserializeRunStepDeltaCodeInterpreterLogOutput(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string logs = default; - int index = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("logs"u8)) - { - logs = property.Value.GetString(); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaCodeInterpreterLogOutput(index, type, serializedAdditionalRawData, logs); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterLogOutput)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaCodeInterpreterLogOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaCodeInterpreterLogOutput(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterLogOutput)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepDeltaCodeInterpreterLogOutput FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaCodeInterpreterLogOutput(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.cs deleted file mode 100644 index 31f3284b073f7..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterLogOutput.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a log output as produced by the Code Interpreter tool and as represented in a streaming run step's delta tool calls collection. - public partial class RunStepDeltaCodeInterpreterLogOutput : RunStepDeltaCodeInterpreterOutput - { - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - internal RunStepDeltaCodeInterpreterLogOutput(int index) : base(index) - { - Type = "logs"; - } - - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - /// The type of the streaming run step tool call's Code Interpreter output. - /// Keeps track of any properties unknown to the library. - /// The text output from the Code Interpreter tool call. - internal RunStepDeltaCodeInterpreterLogOutput(int index, string type, IDictionary serializedAdditionalRawData, string logs) : base(index, type, serializedAdditionalRawData) - { - Logs = logs; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaCodeInterpreterLogOutput() - { - } - - /// The text output from the Code Interpreter tool call. - public string Logs { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.Serialization.cs deleted file mode 100644 index 2acd096c6a7e4..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.Serialization.cs +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - [PersistableModelProxy(typeof(UnknownRunStepDeltaCodeInterpreterOutput))] - public partial class RunStepDeltaCodeInterpreterOutput : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("index"u8); - writer.WriteNumberValue(Index); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaCodeInterpreterOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaCodeInterpreterOutput(document.RootElement, options); - } - - internal static RunStepDeltaCodeInterpreterOutput DeserializeRunStepDeltaCodeInterpreterOutput(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "image": return RunStepDeltaCodeInterpreterImageOutput.DeserializeRunStepDeltaCodeInterpreterImageOutput(element, options); - case "logs": return RunStepDeltaCodeInterpreterLogOutput.DeserializeRunStepDeltaCodeInterpreterLogOutput(element, options); - } - } - return UnknownRunStepDeltaCodeInterpreterOutput.DeserializeUnknownRunStepDeltaCodeInterpreterOutput(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaCodeInterpreterOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaCodeInterpreterOutput(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaCodeInterpreterOutput FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaCodeInterpreterOutput(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.cs deleted file mode 100644 index 656ea7ded2c36..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterOutput.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// - /// The abstract base representation of a streaming run step tool call's Code Interpreter tool output. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class RunStepDeltaCodeInterpreterOutput - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - protected RunStepDeltaCodeInterpreterOutput(int index) - { - Index = index; - } - - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - /// The type of the streaming run step tool call's Code Interpreter output. - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaCodeInterpreterOutput(int index, string type, IDictionary serializedAdditionalRawData) - { - Index = index; - Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaCodeInterpreterOutput() - { - } - - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - public int Index { get; } - /// The type of the streaming run step tool call's Code Interpreter output. - internal string Type { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.Serialization.cs deleted file mode 100644 index 3b5ed23998204..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.Serialization.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaCodeInterpreterToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterToolCall)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(CodeInterpreter)) - { - writer.WritePropertyName("code_interpreter"u8); - writer.WriteObjectValue(CodeInterpreter, options); - } - } - - RunStepDeltaCodeInterpreterToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaCodeInterpreterToolCall(document.RootElement, options); - } - - internal static RunStepDeltaCodeInterpreterToolCall DeserializeRunStepDeltaCodeInterpreterToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - RunStepDeltaCodeInterpreterDetailItemObject codeInterpreter = default; - int index = default; - string id = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code_interpreter"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - codeInterpreter = RunStepDeltaCodeInterpreterDetailItemObject.DeserializeRunStepDeltaCodeInterpreterDetailItemObject(property.Value, options); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaCodeInterpreterToolCall(index, id, type, serializedAdditionalRawData, codeInterpreter); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaCodeInterpreterToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaCodeInterpreterToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepDeltaCodeInterpreterToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaCodeInterpreterToolCall(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.cs deleted file mode 100644 index 8483fa22d47fa..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaCodeInterpreterToolCall.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a Code Interpreter tool call within a streaming run step's tool call details. - public partial class RunStepDeltaCodeInterpreterToolCall : RunStepDeltaToolCall - { - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// is null. - internal RunStepDeltaCodeInterpreterToolCall(int index, string id) : base(index, id) - { - Argument.AssertNotNull(id, nameof(id)); - - Type = "code_interpreter"; - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The type of the tool call detail item in a streaming run step's details. - /// Keeps track of any properties unknown to the library. - /// The Code Interpreter data for the tool call. - internal RunStepDeltaCodeInterpreterToolCall(int index, string id, string type, IDictionary serializedAdditionalRawData, RunStepDeltaCodeInterpreterDetailItemObject codeInterpreter) : base(index, id, type, serializedAdditionalRawData) - { - CodeInterpreter = codeInterpreter; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaCodeInterpreterToolCall() - { - } - - /// The Code Interpreter data for the tool call. - public RunStepDeltaCodeInterpreterDetailItemObject CodeInterpreter { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.Serialization.cs deleted file mode 100644 index bdbed54464d49..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.Serialization.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - [PersistableModelProxy(typeof(UnknownRunStepDeltaDetail))] - public partial class RunStepDeltaDetail : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaDetail(document.RootElement, options); - } - - internal static RunStepDeltaDetail DeserializeRunStepDeltaDetail(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "message_creation": return RunStepDeltaMessageCreation.DeserializeRunStepDeltaMessageCreation(element, options); - case "tool_calls": return RunStepDeltaToolCallObject.DeserializeRunStepDeltaToolCallObject(element, options); - } - } - return UnknownRunStepDeltaDetail.DeserializeUnknownRunStepDeltaDetail(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaDetail(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaDetail FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaDetail(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.cs deleted file mode 100644 index 68de601fb5370..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaDetail.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// - /// Represents a single run step detail item in a streaming run step's delta payload. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class RunStepDeltaDetail - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - protected RunStepDeltaDetail() - { - } - - /// Initializes a new instance of . - /// The object type for the run step detail object. - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaDetail(string type, IDictionary serializedAdditionalRawData) - { - Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The object type for the run step detail object. - internal string Type { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.Serialization.cs deleted file mode 100644 index 91ba8b9552801..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.Serialization.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaFileSearchToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaFileSearchToolCall)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsCollectionDefined(FileSearch)) - { - writer.WritePropertyName("file_search"u8); - writer.WriteStartObject(); - foreach (var item in FileSearch) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - } - - RunStepDeltaFileSearchToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaFileSearchToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaFileSearchToolCall(document.RootElement, options); - } - - internal static RunStepDeltaFileSearchToolCall DeserializeRunStepDeltaFileSearchToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyDictionary fileSearch = default; - int index = default; - string id = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("file_search"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - fileSearch = dictionary; - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaFileSearchToolCall(index, id, type, serializedAdditionalRawData, fileSearch ?? new ChangeTrackingDictionary()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaFileSearchToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaFileSearchToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaFileSearchToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaFileSearchToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepDeltaFileSearchToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaFileSearchToolCall(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.cs deleted file mode 100644 index f29a6476bedd8..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFileSearchToolCall.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a file search tool call within a streaming run step's tool call details. - public partial class RunStepDeltaFileSearchToolCall : RunStepDeltaToolCall - { - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// is null. - internal RunStepDeltaFileSearchToolCall(int index, string id) : base(index, id) - { - Argument.AssertNotNull(id, nameof(id)); - - Type = "file_search"; - FileSearch = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The type of the tool call detail item in a streaming run step's details. - /// Keeps track of any properties unknown to the library. - /// Reserved for future use. - internal RunStepDeltaFileSearchToolCall(int index, string id, string type, IDictionary serializedAdditionalRawData, IReadOnlyDictionary fileSearch) : base(index, id, type, serializedAdditionalRawData) - { - FileSearch = fileSearch; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaFileSearchToolCall() - { - } - - /// Reserved for future use. - public IReadOnlyDictionary FileSearch { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.Serialization.cs deleted file mode 100644 index 6c735eb7a2e51..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.Serialization.cs +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaFunction : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaFunction)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Arguments)) - { - writer.WritePropertyName("arguments"u8); - writer.WriteStringValue(Arguments); - } - if (Optional.IsDefined(Output)) - { - if (Output != null) - { - writer.WritePropertyName("output"u8); - writer.WriteStringValue(Output); - } - else - { - writer.WriteNull("output"); - } - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaFunction IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaFunction)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaFunction(document.RootElement, options); - } - - internal static RunStepDeltaFunction DeserializeRunStepDeltaFunction(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string arguments = default; - string output = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("arguments"u8)) - { - arguments = property.Value.GetString(); - continue; - } - if (property.NameEquals("output"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - output = null; - continue; - } - output = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaFunction(name, arguments, output, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaFunction)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaFunction IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaFunction(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaFunction)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaFunction FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaFunction(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.cs deleted file mode 100644 index 70f21095badd3..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunction.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the function data in a streaming run step delta's function tool call. - public partial class RunStepDeltaFunction - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal RunStepDeltaFunction() - { - } - - /// Initializes a new instance of . - /// The name of the function. - /// The arguments passed to the function as input. - /// The output of the function, null if outputs have not yet been submitted. - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaFunction(string name, string arguments, string output, IDictionary serializedAdditionalRawData) - { - Name = name; - Arguments = arguments; - Output = output; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The name of the function. - public string Name { get; } - /// The arguments passed to the function as input. - public string Arguments { get; } - /// The output of the function, null if outputs have not yet been submitted. - public string Output { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.Serialization.cs deleted file mode 100644 index b22a5a375395a..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.Serialization.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaFunctionToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaFunctionToolCall)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Function)) - { - writer.WritePropertyName("function"u8); - writer.WriteObjectValue(Function, options); - } - } - - RunStepDeltaFunctionToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaFunctionToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaFunctionToolCall(document.RootElement, options); - } - - internal static RunStepDeltaFunctionToolCall DeserializeRunStepDeltaFunctionToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - RunStepDeltaFunction function = default; - int index = default; - string id = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("function"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - function = RunStepDeltaFunction.DeserializeRunStepDeltaFunction(property.Value, options); - continue; - } - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaFunctionToolCall(index, id, type, serializedAdditionalRawData, function); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaFunctionToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaFunctionToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaFunctionToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaFunctionToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepDeltaFunctionToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaFunctionToolCall(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.cs deleted file mode 100644 index 1347a2ce39bf3..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaFunctionToolCall.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a function tool call within a streaming run step's tool call details. - public partial class RunStepDeltaFunctionToolCall : RunStepDeltaToolCall - { - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// is null. - internal RunStepDeltaFunctionToolCall(int index, string id) : base(index, id) - { - Argument.AssertNotNull(id, nameof(id)); - - Type = "function"; - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The type of the tool call detail item in a streaming run step's details. - /// Keeps track of any properties unknown to the library. - /// The function data for the tool call. - internal RunStepDeltaFunctionToolCall(int index, string id, string type, IDictionary serializedAdditionalRawData, RunStepDeltaFunction function) : base(index, id, type, serializedAdditionalRawData) - { - Function = function; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaFunctionToolCall() - { - } - - /// The function data for the tool call. - public RunStepDeltaFunction Function { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.Serialization.cs deleted file mode 100644 index 5183116f42612..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.Serialization.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaMessageCreation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreation)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(MessageCreation)) - { - writer.WritePropertyName("message_creation"u8); - writer.WriteObjectValue(MessageCreation, options); - } - } - - RunStepDeltaMessageCreation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaMessageCreation(document.RootElement, options); - } - - internal static RunStepDeltaMessageCreation DeserializeRunStepDeltaMessageCreation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - RunStepDeltaMessageCreationObject messageCreation = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("message_creation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - messageCreation = RunStepDeltaMessageCreationObject.DeserializeRunStepDeltaMessageCreationObject(property.Value, options); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaMessageCreation(type, serializedAdditionalRawData, messageCreation); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreation)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaMessageCreation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaMessageCreation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepDeltaMessageCreation FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaMessageCreation(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.cs deleted file mode 100644 index c455f53269175..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreation.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents a message creation within a streaming run step delta. - public partial class RunStepDeltaMessageCreation : RunStepDeltaDetail - { - /// Initializes a new instance of . - internal RunStepDeltaMessageCreation() - { - Type = "message_creation"; - } - - /// Initializes a new instance of . - /// The object type for the run step detail object. - /// Keeps track of any properties unknown to the library. - /// The message creation data. - internal RunStepDeltaMessageCreation(string type, IDictionary serializedAdditionalRawData, RunStepDeltaMessageCreationObject messageCreation) : base(type, serializedAdditionalRawData) - { - MessageCreation = messageCreation; - } - - /// The message creation data. - public RunStepDeltaMessageCreationObject MessageCreation { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs deleted file mode 100644 index c9a526ba9412f..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.Serialization.cs +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaMessageCreationObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(MessageId)) - { - writer.WritePropertyName("message_id"u8); - writer.WriteStringValue(MessageId); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaMessageCreationObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaMessageCreationObject(document.RootElement, options); - } - - internal static RunStepDeltaMessageCreationObject DeserializeRunStepDeltaMessageCreationObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string messageId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("message_id"u8)) - { - messageId = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaMessageCreationObject(messageId, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaMessageCreationObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaMessageCreationObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaMessageCreationObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaMessageCreationObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaMessageCreationObject(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.cs deleted file mode 100644 index 076a5a1114fc4..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaMessageCreationObject.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents the data within a streaming run step message creation response object. - public partial class RunStepDeltaMessageCreationObject - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal RunStepDeltaMessageCreationObject() - { - } - - /// Initializes a new instance of . - /// The ID of the newly-created message. - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaMessageCreationObject(string messageId, IDictionary serializedAdditionalRawData) - { - MessageId = messageId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The ID of the newly-created message. - public string MessageId { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.Serialization.cs deleted file mode 100644 index ffe44e8ef4641..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.Serialization.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - [PersistableModelProxy(typeof(UnknownRunStepDeltaToolCall))] - public partial class RunStepDeltaToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("index"u8); - writer.WriteNumberValue(Index); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(Type); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - RunStepDeltaToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaToolCall(document.RootElement, options); - } - - internal static RunStepDeltaToolCall DeserializeRunStepDeltaToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "code_interpreter": return RunStepDeltaCodeInterpreterToolCall.DeserializeRunStepDeltaCodeInterpreterToolCall(element, options); - case "file_search": return RunStepDeltaFileSearchToolCall.DeserializeRunStepDeltaFileSearchToolCall(element, options); - case "function": return RunStepDeltaFunctionToolCall.DeserializeRunStepDeltaFunctionToolCall(element, options); - } - } - return UnknownRunStepDeltaToolCall.DeserializeUnknownRunStepDeltaToolCall(element, options); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static RunStepDeltaToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaToolCall(document.RootElement); - } - - /// Convert into a . - internal virtual RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.cs deleted file mode 100644 index 198aae90f407c..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCall.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// - /// The abstract base representation of a single tool call within a streaming run step's delta tool call details. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class RunStepDeltaToolCall - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private protected IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// is null. - protected RunStepDeltaToolCall(int index, string id) - { - Argument.AssertNotNull(id, nameof(id)); - - Index = index; - Id = id; - } - - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The type of the tool call detail item in a streaming run step's details. - /// Keeps track of any properties unknown to the library. - internal RunStepDeltaToolCall(int index, string id, string type, IDictionary serializedAdditionalRawData) - { - Index = index; - Id = id; - Type = type; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal RunStepDeltaToolCall() - { - } - - /// The index of the tool call detail in the run step's tool_calls array. - public int Index { get; } - /// The ID of the tool call, used when submitting outputs to the run. - public string Id { get; } - /// The type of the tool call detail item in a streaming run step's details. - internal string Type { get; set; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.Serialization.cs deleted file mode 100644 index 01ec769d0882b..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.Serialization.cs +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - public partial class RunStepDeltaToolCallObject : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaToolCallObject)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - if (Optional.IsCollectionDefined(ToolCalls)) - { - writer.WritePropertyName("tool_calls"u8); - writer.WriteStartArray(); - foreach (var item in ToolCalls) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - } - - RunStepDeltaToolCallObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaToolCallObject)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaToolCallObject(document.RootElement, options); - } - - internal static RunStepDeltaToolCallObject DeserializeRunStepDeltaToolCallObject(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList toolCalls = default; - string type = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tool_calls"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RunStepDeltaToolCall.DeserializeRunStepDeltaToolCall(item, options)); - } - toolCalls = array; - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunStepDeltaToolCallObject(type, serializedAdditionalRawData, toolCalls ?? new ChangeTrackingList()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaToolCallObject)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaToolCallObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaToolCallObject(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaToolCallObject)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new RunStepDeltaToolCallObject FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeRunStepDeltaToolCallObject(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.cs deleted file mode 100644 index 5778fcda8a0b1..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepDeltaToolCallObject.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Represents an invocation of tool calls as part of a streaming run step. - public partial class RunStepDeltaToolCallObject : RunStepDeltaDetail - { - /// Initializes a new instance of . - internal RunStepDeltaToolCallObject() - { - Type = "tool_calls"; - ToolCalls = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The object type for the run step detail object. - /// Keeps track of any properties unknown to the library. - /// - /// The collection of tool calls for the tool call detail item. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - internal RunStepDeltaToolCallObject(string type, IDictionary serializedAdditionalRawData, IReadOnlyList toolCalls) : base(type, serializedAdditionalRawData) - { - ToolCalls = toolCalls; - } - - /// - /// The collection of tool calls for the tool call detail item. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public IReadOnlyList ToolCalls { get; } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStepStreamEvent.cs deleted file mode 100644 index 423b575c14a94..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStepStreamEvent.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// Run step operation related streaming events. - public readonly partial struct RunStepStreamEvent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RunStepStreamEvent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadRunStepCreatedValue = "thread.run.step.created"; - private const string ThreadRunStepInProgressValue = "thread.run.step.in_progress"; - private const string ThreadRunStepDeltaValue = "thread.run.step.delta"; - private const string ThreadRunStepCompletedValue = "thread.run.step.completed"; - private const string ThreadRunStepFailedValue = "thread.run.step.failed"; - private const string ThreadRunStepCancelledValue = "thread.run.step.cancelled"; - private const string ThreadRunStepExpiredValue = "thread.run.step.expired"; - - /// Event sent when a new thread run step is created. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepCreated { get; } = new RunStepStreamEvent(ThreadRunStepCreatedValue); - /// Event sent when a run step moves to `in_progress` status. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepInProgress { get; } = new RunStepStreamEvent(ThreadRunStepInProgressValue); - /// Event sent when a run step is being streamed. The data of this event is of type RunStepDeltaChunk. - public static RunStepStreamEvent ThreadRunStepDelta { get; } = new RunStepStreamEvent(ThreadRunStepDeltaValue); - /// Event sent when a run step is completed. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepCompleted { get; } = new RunStepStreamEvent(ThreadRunStepCompletedValue); - /// Event sent when a run step fails. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepFailed { get; } = new RunStepStreamEvent(ThreadRunStepFailedValue); - /// Event sent when a run step is cancelled. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepCancelled { get; } = new RunStepStreamEvent(ThreadRunStepCancelledValue); - /// Event sent when a run step is expired. The data of this event is of type RunStep. - public static RunStepStreamEvent ThreadRunStepExpired { get; } = new RunStepStreamEvent(ThreadRunStepExpiredValue); - /// Determines if two values are the same. - public static bool operator ==(RunStepStreamEvent left, RunStepStreamEvent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RunStepStreamEvent left, RunStepStreamEvent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator RunStepStreamEvent(string value) => new RunStepStreamEvent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RunStepStreamEvent other && Equals(other); - /// - public bool Equals(RunStepStreamEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs deleted file mode 100644 index b3fd0dcab2ef8..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/RunStreamEvent.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// Run operation related streaming events. - public readonly partial struct RunStreamEvent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RunStreamEvent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadRunCreatedValue = "thread.run.created"; - private const string ThreadRunQueuedValue = "thread.run.queued"; - private const string ThreadRunInProgressValue = "thread.run.in_progress"; - private const string ThreadRunRequiresActionValue = "thread.run.requires_action"; - private const string ThreadRunCompletedValue = "thread.run.completed"; - private const string ThreadRunIncompleteValue = "thread.run.incomplete"; - private const string ThreadRunFailedValue = "thread.run.failed"; - private const string ThreadRunCancellingValue = "thread.run.cancelling"; - private const string ThreadRunCancelledValue = "thread.run.cancelled"; - private const string ThreadRunExpiredValue = "thread.run.expired"; - - /// Event sent when a new run is created. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunCreated { get; } = new RunStreamEvent(ThreadRunCreatedValue); - /// Event sent when a run moves to `queued` status. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunQueued { get; } = new RunStreamEvent(ThreadRunQueuedValue); - /// Event sent when a run moves to `in_progress` status. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunInProgress { get; } = new RunStreamEvent(ThreadRunInProgressValue); - /// Event sent when a run moves to `requires_action` status. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunRequiresAction { get; } = new RunStreamEvent(ThreadRunRequiresActionValue); - /// Event sent when a run is completed. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunCompleted { get; } = new RunStreamEvent(ThreadRunCompletedValue); - /// Event sent when a run ends incomplete. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunIncomplete { get; } = new RunStreamEvent(ThreadRunIncompleteValue); - /// Event sent when a run fails. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunFailed { get; } = new RunStreamEvent(ThreadRunFailedValue); - /// Event sent when a run moves to `cancelling` status. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunCancelling { get; } = new RunStreamEvent(ThreadRunCancellingValue); - /// Event sent when a run is cancelled. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunCancelled { get; } = new RunStreamEvent(ThreadRunCancelledValue); - /// Event sent when a run is expired. The data of this event is of type ThreadRun. - public static RunStreamEvent ThreadRunExpired { get; } = new RunStreamEvent(ThreadRunExpiredValue); - /// Determines if two values are the same. - public static bool operator ==(RunStreamEvent left, RunStreamEvent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RunStreamEvent left, RunStreamEvent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator RunStreamEvent(string value) => new RunStreamEvent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RunStreamEvent other && Equals(other); - /// - public bool Equals(RunStreamEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadStreamEvent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/ThreadStreamEvent.cs deleted file mode 100644 index 446ffec4a4b9d..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/ThreadStreamEvent.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.AI.Projects -{ - /// Thread operation related streaming events. - public readonly partial struct ThreadStreamEvent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ThreadStreamEvent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ThreadCreatedValue = "thread.created"; - - /// Event sent when a new thread is created. The data of this event is of type AgentThread. - public static ThreadStreamEvent ThreadCreated { get; } = new ThreadStreamEvent(ThreadCreatedValue); - /// Determines if two values are the same. - public static bool operator ==(ThreadStreamEvent left, ThreadStreamEvent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ThreadStreamEvent left, ThreadStreamEvent right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator ThreadStreamEvent(string value) => new ThreadStreamEvent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ThreadStreamEvent other && Equals(other); - /// - public bool Equals(ThreadStreamEvent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.Serialization.cs deleted file mode 100644 index 76352db2197eb..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.Serialization.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - internal partial class UnknownMessageDeltaContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - MessageDeltaContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaContent(document.RootElement, options); - } - - internal static UnknownMessageDeltaContent DeserializeUnknownMessageDeltaContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int index = default; - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownMessageDeltaContent(index, type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new UnknownMessageDeltaContent FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownMessageDeltaContent(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.cs deleted file mode 100644 index 9aa9dd56098fb..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaContent.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Unknown version of MessageDeltaContent. - internal partial class UnknownMessageDeltaContent : MessageDeltaContent - { - /// Initializes a new instance of . - /// The index of the content part of the message. - /// The type of content for this content part. - /// Keeps track of any properties unknown to the library. - internal UnknownMessageDeltaContent(int index, string type, IDictionary serializedAdditionalRawData) : base(index, type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal UnknownMessageDeltaContent() - { - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.Serialization.cs deleted file mode 100644 index 3e73c295a5aba..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.Serialization.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - internal partial class UnknownMessageDeltaTextAnnotation : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - MessageDeltaTextAnnotation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMessageDeltaTextAnnotation(document.RootElement, options); - } - - internal static UnknownMessageDeltaTextAnnotation DeserializeUnknownMessageDeltaTextAnnotation(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int index = default; - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownMessageDeltaTextAnnotation(index, type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support writing '{options.Format}' format."); - } - } - - MessageDeltaTextAnnotation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeMessageDeltaTextAnnotation(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MessageDeltaTextAnnotation)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new UnknownMessageDeltaTextAnnotation FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownMessageDeltaTextAnnotation(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.cs deleted file mode 100644 index c1a702e2bfb25..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownMessageDeltaTextAnnotation.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Unknown version of MessageDeltaTextAnnotation. - internal partial class UnknownMessageDeltaTextAnnotation : MessageDeltaTextAnnotation - { - /// Initializes a new instance of . - /// The index of the annotation within a text content part. - /// The type of the text content annotation. - /// Keeps track of any properties unknown to the library. - internal UnknownMessageDeltaTextAnnotation(int index, string type, IDictionary serializedAdditionalRawData) : base(index, type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal UnknownMessageDeltaTextAnnotation() - { - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs deleted file mode 100644 index 8df010fe02d9b..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.Serialization.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - internal partial class UnknownRunStepDeltaCodeInterpreterOutput : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - RunStepDeltaCodeInterpreterOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaCodeInterpreterOutput(document.RootElement, options); - } - - internal static UnknownRunStepDeltaCodeInterpreterOutput DeserializeUnknownRunStepDeltaCodeInterpreterOutput(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int index = default; - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownRunStepDeltaCodeInterpreterOutput(index, type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaCodeInterpreterOutput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaCodeInterpreterOutput(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaCodeInterpreterOutput)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new UnknownRunStepDeltaCodeInterpreterOutput FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownRunStepDeltaCodeInterpreterOutput(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.cs deleted file mode 100644 index 2aaf69a1c20b3..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaCodeInterpreterOutput.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Unknown version of RunStepDeltaCodeInterpreterOutput. - internal partial class UnknownRunStepDeltaCodeInterpreterOutput : RunStepDeltaCodeInterpreterOutput - { - /// Initializes a new instance of . - /// The index of the output in the streaming run step tool call's Code Interpreter outputs array. - /// The type of the streaming run step tool call's Code Interpreter output. - /// Keeps track of any properties unknown to the library. - internal UnknownRunStepDeltaCodeInterpreterOutput(int index, string type, IDictionary serializedAdditionalRawData) : base(index, type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal UnknownRunStepDeltaCodeInterpreterOutput() - { - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.Serialization.cs deleted file mode 100644 index ae6db6695c967..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.Serialization.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - internal partial class UnknownRunStepDeltaDetail : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - RunStepDeltaDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaDetail(document.RootElement, options); - } - - internal static UnknownRunStepDeltaDetail DeserializeUnknownRunStepDeltaDetail(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownRunStepDeltaDetail(type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaDetail(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaDetail)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new UnknownRunStepDeltaDetail FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownRunStepDeltaDetail(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.cs deleted file mode 100644 index a5ac9c43bae45..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaDetail.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Unknown version of RunStepDeltaDetail. - internal partial class UnknownRunStepDeltaDetail : RunStepDeltaDetail - { - /// Initializes a new instance of . - /// The object type for the run step detail object. - /// Keeps track of any properties unknown to the library. - internal UnknownRunStepDeltaDetail(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal UnknownRunStepDeltaDetail() - { - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.Serialization.cs deleted file mode 100644 index 8febd536f2b14..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.Serialization.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.AI.Projects -{ - internal partial class UnknownRunStepDeltaToolCall : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - } - - RunStepDeltaToolCall IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunStepDeltaToolCall(document.RootElement, options); - } - - internal static UnknownRunStepDeltaToolCall DeserializeUnknownRunStepDeltaToolCall(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int index = default; - string id = default; - string type = "Unknown"; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("index"u8)) - { - index = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new UnknownRunStepDeltaToolCall(index, id, type, serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support writing '{options.Format}' format."); - } - } - - RunStepDeltaToolCall IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunStepDeltaToolCall(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunStepDeltaToolCall)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - - /// Deserializes the model from a raw response. - /// The response to deserialize the model from. - internal static new UnknownRunStepDeltaToolCall FromResponse(Response response) - { - using var document = JsonDocument.Parse(response.Content); - return DeserializeUnknownRunStepDeltaToolCall(document.RootElement); - } - - /// Convert into a . - internal override RequestContent ToRequestContent() - { - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); - return content; - } - } -} diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.cs b/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.cs deleted file mode 100644 index 2c31d5c2b1740..0000000000000 --- a/sdk/ai/Azure.AI.Projects/src/Generated/UnknownRunStepDeltaToolCall.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.AI.Projects -{ - /// Unknown version of RunStepDeltaToolCall. - internal partial class UnknownRunStepDeltaToolCall : RunStepDeltaToolCall - { - /// Initializes a new instance of . - /// The index of the tool call detail in the run step's tool_calls array. - /// The ID of the tool call, used when submitting outputs to the run. - /// The type of the tool call detail item in a streaming run step's details. - /// Keeps track of any properties unknown to the library. - internal UnknownRunStepDeltaToolCall(int index, string id, string type, IDictionary serializedAdditionalRawData) : base(index, id, type, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal UnknownRunStepDeltaToolCall() - { - } - } -} diff --git a/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml b/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml index 2106f52e75e05..105b119931537 100644 --- a/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml +++ b/sdk/batch/Azure.Compute.Batch/src/Generated/Docs/BatchClient.xml @@ -63,7 +63,21 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TargetDedicatedNodes = 2, + NetworkConfiguration = new NetworkConfiguration + { + EnableAcceleratedNetworking = true, + }, +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -72,7 +86,46 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + MountConfiguration = {new MountConfiguration + { + AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") + { + AccountKey = "accountKey", + }, + }, new MountConfiguration + { + AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") + { + MountOptions = "mount options ver=1.0", + }, + }, new MountConfiguration + { + NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") + { + MountOptions = "mount options ver=1.0", + }, + }, new MountConfiguration + { + CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") + { + MountOptions = "mount options ver=1.0", + }, + }}, +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -81,7 +134,32 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + OsDisk = new OSDisk + { + EphemeralOSDiskSettings = new DiffDiskSettings + { + Placement = DiffDiskPlacement.CacheDisk, + }, + Caching = CachingType.ReadWrite, + DiskSizeGB = 100, + ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 1, +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -90,7 +168,22 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04"), + ResourceTags = + { + ["TagName1"] = "TagValue1", + ["TagName2"] = "TagValue2" + }, + TargetDedicatedNodes = 1, +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -99,7 +192,23 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04") + { + SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings + { + SecureBootEnabled = false, + }), + }, + TargetDedicatedNodes = 1, +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -108,7 +217,23 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -117,7 +242,27 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "120_04-lts", + }, "batch.node.ubuntu 20.04") + { + ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) + { + ContainerImageNames = { "busybox" }, + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -126,7 +271,37 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") + { + TypeHandlerVersion = "2.0", + AutoUpgradeMinorVersion = true, + EnableAutomaticUpgrade = true, + Settings = + { + ["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", + ["authenticationSettingsKey"] = "authenticationSettingsValue" + }, + }}, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, +}; Response response = await client.CreatePoolAsync(pool); ]]> This sample shows how to call CreatePoolAsync. @@ -135,7 +310,24 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), + }, + TargetDedicatedNodes = 2, +}; Response response = await client.CreatePoolAsync(pool); ]]> @@ -147,7 +339,21 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TargetDedicatedNodes = 2, + NetworkConfiguration = new NetworkConfiguration + { + EnableAcceleratedNetworking = true, + }, +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -156,7 +362,46 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + MountConfiguration = {new MountConfiguration + { + AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") + { + AccountKey = "accountKey", + }, + }, new MountConfiguration + { + AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") + { + MountOptions = "mount options ver=1.0", + }, + }, new MountConfiguration + { + NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") + { + MountOptions = "mount options ver=1.0", + }, + }, new MountConfiguration + { + CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") + { + MountOptions = "mount options ver=1.0", + }, + }}, +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -165,7 +410,32 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + OsDisk = new OSDisk + { + EphemeralOSDiskSettings = new DiffDiskSettings + { + Placement = DiffDiskPlacement.CacheDisk, + }, + Caching = CachingType.ReadWrite, + DiskSizeGB = 100, + ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 1, +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -174,7 +444,22 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04"), + ResourceTags = + { + ["TagName1"] = "TagValue1", + ["TagName2"] = "TagValue2" + }, + TargetDedicatedNodes = 1, +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -183,7 +468,23 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04") + { + SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings + { + SecureBootEnabled = false, + }), + }, + TargetDedicatedNodes = 1, +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -192,7 +493,23 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -201,7 +518,27 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "120_04-lts", + }, "batch.node.ubuntu 20.04") + { + ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) + { + ContainerImageNames = { "busybox" }, + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -210,7 +547,37 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") + { + TypeHandlerVersion = "2.0", + AutoUpgradeMinorVersion = true, + EnableAutomaticUpgrade = true, + Settings = + { + ["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", + ["authenticationSettingsKey"] = "authenticationSettingsValue" + }, + }}, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, +}; Response response = client.CreatePool(pool); ]]> This sample shows how to call CreatePool. @@ -219,7 +586,24 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); +BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") +{ + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), + }, + TargetDedicatedNodes = 2, +}; Response response = client.CreatePool(pool); ]]> @@ -231,7 +615,27 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool01", + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, + networkConfiguration = new + { + enableAcceleratedNetworking = true, + }, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -242,7 +646,74 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + mountConfiguration = new object[] + { + new + { + azureBlobFileSystemConfiguration = new + { + accountName = "accountName", + containerName = "blobContainerName", + accountKey = "accountKey", + relativeMountPath = "bfusepath", + }, + }, + new + { + azureFileShareConfiguration = new + { + accountName = "accountName", + azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", + accountKey = "accountKey", + relativeMountPath = "filesharepath", + mountOptions = "mount options ver=1.0", + }, + }, + new + { + nfsMountConfiguration = new + { + source = "somesource nfs url", + relativeMountPath = "mountpath", + mountOptions = "mount options ver=1.0", + }, + }, + new + { + cifsMountConfiguration = new + { + username = "accountName", + password = "password", + source = "//myaccount.file.core.windows.net/file", + relativeMountPath = "mountpath", + mountOptions = "mount options ver=1.0", + }, + } + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -253,7 +724,39 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool001", + vmSize = "standard_d2s_v3", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + osDisk = new + { + diskSizeGB = 100, + managedDisk = new + { + storageAccountType = "standardssd_lrs", + }, + caching = "readwrite", + ephemeralOSDiskSettings = new + { + placement = "cachedisk", + }, + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 1, + enableAutoScale = false, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -264,7 +767,28 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + }, + targetDedicatedNodes = 1, + resourceTags = new + { + TagName1 = "TagValue1", + TagName2 = "TagValue2", + }, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -275,7 +799,32 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + securityProfile = new + { + securityType = "trustedLaunch", + encryptionAtHost = true, + uefiSettings = new + { + secureBootEnabled = false, + }, + }, + }, + targetDedicatedNodes = 1, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -286,7 +835,39 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -297,7 +878,38 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "120_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new object[] + { + "busybox" + }, + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -308,7 +920,57 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + extensions = new object[] + { + new + { + name = "batchextension1", + type = "KeyVaultForLinux", + publisher = "Microsoft.Azure.KeyVault", + typeHandlerVersion = "2.0", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new + { + secretsManagementSettingsKey = "secretsManagementSettingsValue", + authenticationSettingsKey = "authenticationSettingsValue", + }, + } + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, + targetNodeCommunicationMode = "simplified", +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -319,7 +981,31 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool002", + vmSize = "Standard_A1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + serviceArtifactReference = new + { + id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, +}); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -333,7 +1019,27 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool01", + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, + networkConfiguration = new + { + enableAcceleratedNetworking = true, + }, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -344,7 +1050,74 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + mountConfiguration = new object[] + { + new + { + azureBlobFileSystemConfiguration = new + { + accountName = "accountName", + containerName = "blobContainerName", + accountKey = "accountKey", + relativeMountPath = "bfusepath", + }, + }, + new + { + azureFileShareConfiguration = new + { + accountName = "accountName", + azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", + accountKey = "accountKey", + relativeMountPath = "filesharepath", + mountOptions = "mount options ver=1.0", + }, + }, + new + { + nfsMountConfiguration = new + { + source = "somesource nfs url", + relativeMountPath = "mountpath", + mountOptions = "mount options ver=1.0", + }, + }, + new + { + cifsMountConfiguration = new + { + username = "accountName", + password = "password", + source = "//myaccount.file.core.windows.net/file", + relativeMountPath = "mountpath", + mountOptions = "mount options ver=1.0", + }, + } + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -355,7 +1128,39 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool001", + vmSize = "standard_d2s_v3", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + osDisk = new + { + diskSizeGB = 100, + managedDisk = new + { + storageAccountType = "standardssd_lrs", + }, + caching = "readwrite", + ephemeralOSDiskSettings = new + { + placement = "cachedisk", + }, + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 1, + enableAutoScale = false, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -366,7 +1171,28 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + }, + targetDedicatedNodes = 1, + resourceTags = new + { + TagName1 = "TagValue1", + TagName2 = "TagValue2", + }, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -377,7 +1203,32 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + securityProfile = new + { + securityType = "trustedLaunch", + encryptionAtHost = true, + uefiSettings = new + { + secureBootEnabled = false, + }, + }, + }, + targetDedicatedNodes = 1, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -388,7 +1239,39 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -399,7 +1282,38 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "120_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new object[] + { + "busybox" + }, + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -410,7 +1324,57 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + extensions = new object[] + { + new + { + name = "batchextension1", + type = "KeyVaultForLinux", + publisher = "Microsoft.Azure.KeyVault", + typeHandlerVersion = "2.0", + autoUpgradeMinorVersion = true, + enableAutomaticUpgrade = true, + settings = new + { + secretsManagementSettingsKey = "secretsManagementSettingsValue", + authenticationSettingsKey = "authenticationSettingsValue", + }, + } + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, + targetNodeCommunicationMode = "simplified", +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -421,7 +1385,31 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "mypool002", + vmSize = "Standard_A1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + serviceArtifactReference = new + { + id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, +}); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -701,7 +1689,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, +}); Response response = await client.UpdatePoolAsync("poolId", content); Console.WriteLine(response.Status); @@ -715,7 +1709,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, +}); Response response = client.UpdatePool("poolId", content); Console.WriteLine(response.Status); @@ -755,7 +1755,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); +BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent +{ + AutoScaleFormula = "$TargetDedicated=0", + AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), +}; Response response = await client.EnablePoolAutoScaleAsync("poolId", content); ]]> @@ -767,7 +1771,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); +BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent +{ + AutoScaleFormula = "$TargetDedicated=0", + AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), +}; Response response = client.EnablePoolAutoScale("poolId", content); ]]> @@ -779,7 +1787,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + autoScaleFormula = "$TargetDedicated=0", + autoScaleEvaluationInterval = "PT8M", +}); Response response = await client.EnablePoolAutoScaleAsync("poolId", content); Console.WriteLine(response.Status); @@ -793,7 +1805,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + autoScaleFormula = "$TargetDedicated=0", + autoScaleEvaluationInterval = "PT8M", +}); Response response = client.EnablePoolAutoScale("poolId", content); Console.WriteLine(response.Status); @@ -807,7 +1823,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); +BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); ]]> @@ -819,7 +1835,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); +BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); Response response = client.EvaluatePoolAutoScale("poolId", content); ]]> @@ -831,7 +1847,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + autoScaleFormula = "$TargetDedicated=1", +}); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -846,7 +1865,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + autoScaleFormula = "$TargetDedicated=1", +}); Response response = client.EvaluatePoolAutoScale("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -861,7 +1883,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolResizeContent content = new BatchPoolResizeContent(); +BatchPoolResizeContent content = new BatchPoolResizeContent +{ + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, +}; Response response = await client.ResizePoolAsync("resizePool", content); ]]> @@ -873,7 +1899,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolResizeContent content = new BatchPoolResizeContent(); +BatchPoolResizeContent content = new BatchPoolResizeContent +{ + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, +}; Response response = client.ResizePool("resizePool", content); ]]> @@ -885,7 +1915,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, +}); Response response = await client.ResizePoolAsync("resizePool", content); Console.WriteLine(response.Status); @@ -899,7 +1933,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, +}); Response response = client.ResizePool("resizePool", content); Console.WriteLine(response.Status); @@ -939,7 +1977,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); +BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) +{ + StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), +}; Response response = await client.ReplacePoolPropertiesAsync("poolId", pool); ]]> @@ -951,7 +1992,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); +BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) +{ + StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), +}; Response response = client.ReplacePoolProperties("poolId", pool); ]]> @@ -963,7 +2007,15 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, + applicationPackageReferences = Array.Empty(), + metadata = Array.Empty(), +}); Response response = await client.ReplacePoolPropertiesAsync("poolId", content); Console.WriteLine(response.Status); @@ -977,7 +2029,15 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, + applicationPackageReferences = Array.Empty(), + metadata = Array.Empty(), +}); Response response = client.ReplacePoolProperties("poolId", content); Console.WriteLine(response.Status); @@ -991,7 +2051,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); +BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); Response response = await client.RemoveNodesAsync("poolId", content); ]]> @@ -1003,7 +2063,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); +BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); Response response = client.RemoveNodes("poolId", content); ]]> @@ -1015,7 +2075,14 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + nodeList = new object[] + { + "tvm-1695681911_1-20161122t224741z", + "tvm-1695681911_2-20161122t224741z" + }, +}); Response response = await client.RemoveNodesAsync("poolId", content); Console.WriteLine(response.Status); @@ -1029,7 +2096,14 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + nodeList = new object[] + { + "tvm-1695681911_1-20161122t224741z", + "tvm-1695681911_2-20161122t224741z" + }, +}); Response response = client.RemoveNodes("poolId", content); Console.WriteLine(response.Status); @@ -1119,7 +2193,19 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + poolInfo = new + { + poolId = "poolId", + }, +}); Response response = await client.UpdateJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -1133,7 +2219,19 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + poolInfo = new + { + poolId = "poolId", + }, +}); Response response = client.UpdateJob("jobId", content); Console.WriteLine(response.Status); @@ -1245,7 +2343,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobDisableContent content = new BatchJobDisableContent(default); +BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); Response response = await client.DisableJobAsync("jobId", content); ]]> @@ -1257,7 +2355,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobDisableContent content = new BatchJobDisableContent(default); +BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); Response response = client.DisableJob("jobId", content); ]]> @@ -1269,7 +2367,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + disableTasks = "terminate", +}); Response response = await client.DisableJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -1283,7 +2384,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + disableTasks = "terminate", +}); Response response = client.DisableJob("jobId", content); Console.WriteLine(response.Status); @@ -1373,7 +2477,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent(null, null); +BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo +{ + PoolId = "poolId", +}) +{ + Priority = 0, +}; Response response = await client.CreateJobAsync(job); ]]> This sample shows how to call CreateJobAsync. @@ -1382,7 +2492,96 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent(null, null); +BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo +{ + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + FilePath = "myprogram2.exe", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, +}) +{ + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + FilePath = "myprogram.exe", + }, new ResourceFile + { + StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", + FilePath = "datafolder", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = false, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + RunExclusive = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, +}; Response response = await client.CreateJobAsync(job); ]]> @@ -1394,7 +2593,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent(null, null); +BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo +{ + PoolId = "poolId", +}) +{ + Priority = 0, +}; Response response = client.CreateJob(job); ]]> This sample shows how to call CreateJob. @@ -1403,7 +2608,96 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobCreateContent job = new BatchJobCreateContent(null, null); +BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo +{ + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + FilePath = "myprogram2.exe", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, +}) +{ + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + FilePath = "myprogram.exe", + }, new ResourceFile + { + StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", + FilePath = "datafolder", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = false, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + RunExclusive = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, +}; Response response = client.CreateJob(job); ]]> @@ -1415,7 +2709,15 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobId", + priority = 0, + poolInfo = new + { + poolId = "poolId", + }, +}); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -1426,7 +2728,139 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobId", + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "taskId", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + filePath = "myprogram.exe", + }, + new + { + storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", + filePath = "datafolder", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = false, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "job", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + filePath = "myprogram2.exe", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, +}); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -1440,7 +2874,15 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobId", + priority = 0, + poolInfo = new + { + poolId = "poolId", + }, +}); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -1451,7 +2893,139 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobId", + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "taskId", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + filePath = "myprogram.exe", + }, + new + { + storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", + filePath = "datafolder", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = false, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "job", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + filePath = "myprogram2.exe", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, +}); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -1609,7 +3183,27 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + schedule = new + { + doNotRunUntil = "2025-01-01T12:30:00Z", + }, + jobSpecification = new + { + priority = 0, + usesTaskDependencies = false, + constraints = new + { + maxWallClockTime = "P10675199DT2H48M5.4775807S", + maxTaskRetryCount = 0, + }, + poolInfo = new + { + poolId = "poolId", + }, + }, +}); Response response = await client.UpdateJobScheduleAsync("jobScheduleId", content); Console.WriteLine(response.Status); @@ -1623,7 +3217,27 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + schedule = new + { + doNotRunUntil = "2025-01-01T12:30:00Z", + }, + jobSpecification = new + { + priority = 0, + usesTaskDependencies = false, + constraints = new + { + maxWallClockTime = "P10675199DT2H48M5.4775807S", + maxTaskRetryCount = 0, + }, + poolInfo = new + { + poolId = "poolId", + }, + }, +}); Response response = client.UpdateJobSchedule("jobScheduleId", content); Console.WriteLine(response.Status); @@ -1843,7 +3457,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration +{ + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), +}, new BatchJobSpecification(new BatchPoolInfo +{ + PoolId = "poolId", +})); Response response = await client.CreateJobScheduleAsync(jobSchedule); ]]> This sample shows how to call CreateJobScheduleAsync. @@ -1852,7 +3472,104 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration +{ + DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), + DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), + StartWindow = XmlConvert.ToTimeSpan("PT1M"), + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), +}, new BatchJobSpecification(new BatchPoolInfo +{ + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + FilePath = "myprogram2.exe", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, +}) +{ + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + FilePath = "myprogram.exe", + }, new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", + FilePath = "test.txt", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = true, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + RunExclusive = true, + }, +}) +{ + Metadata = { new MetadataItem("myproperty", "myvalue") }, +}; Response response = await client.CreateJobScheduleAsync(jobSchedule); ]]> @@ -1864,7 +3581,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration +{ + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), +}, new BatchJobSpecification(new BatchPoolInfo +{ + PoolId = "poolId", +})); Response response = client.CreateJobSchedule(jobSchedule); ]]> This sample shows how to call CreateJobSchedule. @@ -1873,7 +3596,104 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); +BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration +{ + DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), + DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), + StartWindow = XmlConvert.ToTimeSpan("PT1M"), + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), +}, new BatchJobSpecification(new BatchPoolInfo +{ + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + FilePath = "myprogram2.exe", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, +}) +{ + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") + { + ResourceFiles = {new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + FilePath = "myprogram.exe", + }, new ResourceFile + { + HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", + FilePath = "test.txt", + }}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") + { + Value = "myvalue", + }}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = true, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + RunExclusive = true, + }, +}) +{ + Metadata = { new MetadataItem("myproperty", "myvalue") }, +}; Response response = client.CreateJobSchedule(jobSchedule); ]]> @@ -1885,7 +3705,21 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobScheduleId", + schedule = new + { + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + poolInfo = new + { + poolId = "poolId", + }, + }, +}); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -1896,7 +3730,149 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobScheduleId", + schedule = new + { + doNotRunUntil = "2014-09-10T02:30:00.000Z", + doNotRunAfter = "2014-09-10T06:30:00.000Z", + startWindow = "PT1M", + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "mytask1", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + filePath = "myprogram.exe", + }, + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", + filePath = "test.txt", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = true, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "jobschedule", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + filePath = "myprogram2.exe", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, +}); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -1910,7 +3886,21 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobScheduleId", + schedule = new + { + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + poolInfo = new + { + poolId = "poolId", + }, + }, +}); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -1921,7 +3911,149 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "jobScheduleId", + schedule = new + { + doNotRunUntil = "2014-09-10T02:30:00.000Z", + doNotRunAfter = "2014-09-10T06:30:00.000Z", + startWindow = "PT1M", + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "mytask1", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", + filePath = "myprogram.exe", + }, + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", + filePath = "test.txt", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = true, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "jobschedule", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { + new + { + httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", + filePath = "myprogram2.exe", + } + }, + environmentSettings = new object[] + { + new + { + name = "myvariable", + value = "myvalue", + } + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + }, + metadata = new object[] + { + new + { + name = "myproperty", + value = "myvalue", + } + }, +}); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -1935,7 +4067,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); Response response = await client.CreateTaskAsync("jobId", task); ]]> This sample shows how to call CreateTaskAsync. @@ -1944,7 +4076,21 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") +{ + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerRunOptions = "--rm", + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; Response response = await client.CreateTaskAsync("jobId", task); ]]> This sample shows how to call CreateTaskAsync. @@ -1953,7 +4099,24 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") +{ + ExitConditions = new ExitConditions + { + ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions + { + JobAction = BatchJobAction.Terminate, + })}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; Response response = await client.CreateTaskAsync("jobId", task); ]]> This sample shows how to call CreateTaskAsync. @@ -1962,7 +4125,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") +{ + RequiredSlots = 2, +}; Response response = await client.CreateTaskAsync("jobId", task); ]]> @@ -1974,7 +4140,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); Response response = client.CreateTask("jobId", task); ]]> This sample shows how to call CreateTask. @@ -1983,7 +4149,21 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") +{ + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerRunOptions = "--rm", + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; Response response = client.CreateTask("jobId", task); ]]> This sample shows how to call CreateTask. @@ -1992,7 +4172,24 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") +{ + ExitConditions = new ExitConditions + { + ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions + { + JobAction = BatchJobAction.Terminate, + })}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, +}; Response response = client.CreateTask("jobId", task); ]]> This sample shows how to call CreateTask. @@ -2001,7 +4198,10 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); +BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") +{ + RequiredSlots = 2, +}; Response response = client.CreateTask("jobId", task); ]]> @@ -2013,7 +4213,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "task1", + commandLine = "cmd /c echo task1", +}); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2024,7 +4228,24 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerRunOptions = "--rm", + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2035,7 +4256,34 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "cmd /c exit 3", + exitConditions = new + { + exitCodeRanges = new object[] + { + new + { + start = 2, + end = 4, + exitOptions = new + { + jobAction = "terminate", + }, + } + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2046,7 +4294,12 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "task1", + requiredSlots = 2, + commandLine = "cmd /c echo task1", +}); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2060,7 +4313,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "task1", + commandLine = "cmd /c echo task1", +}); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2071,7 +4328,24 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerRunOptions = "--rm", + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2082,7 +4356,34 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "taskId", + commandLine = "cmd /c exit 3", + exitConditions = new + { + exitCodeRanges = new object[] + { + new + { + start = 2, + end = 4, + exitOptions = new + { + jobAction = "terminate", + }, + } + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, +}); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2093,7 +4394,12 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + id = "task1", + requiredSlots = 2, + commandLine = "cmd /c echo task1", +}); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2107,7 +4413,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(null); +BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] +{ + new BatchTaskCreateContent("simple1", "cmd /c dir /s"), + new BatchTaskCreateContent("simple2", "cmd /c dir /s") +}); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); ]]> This sample shows how to call CreateTaskCollectionAsync. @@ -2116,7 +4426,42 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(null); +BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] +{ + new BatchTaskCreateContent("complex1", "cmd /c dir /s") + { + ResourceFiles = {new ResourceFile + { + AutoStorageContainerName = "containerName", + FilePath = "data", + }}, + EnvironmentSettings = {new EnvironmentSetting("env1") + { + Value = "value1", + }, new EnvironmentSetting("env2") + { + Value = "value2", + }}, + AffinityInfo = new AffinityInfo("affinityId"), + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), + RetentionTime = XmlConvert.ToTimeSpan("P2D"), + MaxTaskRetryCount = 5, + }, + RequiredSlots = 2, + MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") + { + NumberOfInstances = 3, + CommonResourceFiles = {new ResourceFile + { + HttpUrl = "https://common.blob.core.windows.net/", + FilePath = "common.exe", + }}, + }, + }, + new BatchTaskCreateContent("simple3", "cmd /c dir /s") +}); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); ]]> @@ -2128,7 +4473,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(null); +BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] +{ + new BatchTaskCreateContent("simple1", "cmd /c dir /s"), + new BatchTaskCreateContent("simple2", "cmd /c dir /s") +}); Response response = client.CreateTaskCollection("jobId", taskCollection); ]]> This sample shows how to call CreateTaskCollection. @@ -2137,7 +4486,42 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchTaskGroup taskCollection = new BatchTaskGroup(null); +BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] +{ + new BatchTaskCreateContent("complex1", "cmd /c dir /s") + { + ResourceFiles = {new ResourceFile + { + AutoStorageContainerName = "containerName", + FilePath = "data", + }}, + EnvironmentSettings = {new EnvironmentSetting("env1") + { + Value = "value1", + }, new EnvironmentSetting("env2") + { + Value = "value2", + }}, + AffinityInfo = new AffinityInfo("affinityId"), + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), + RetentionTime = XmlConvert.ToTimeSpan("P2D"), + MaxTaskRetryCount = 5, + }, + RequiredSlots = 2, + MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") + { + NumberOfInstances = 3, + CommonResourceFiles = {new ResourceFile + { + HttpUrl = "https://common.blob.core.windows.net/", + FilePath = "common.exe", + }}, + }, + }, + new BatchTaskCreateContent("simple3", "cmd /c dir /s") +}); Response response = client.CreateTaskCollection("jobId", taskCollection); ]]> @@ -2149,7 +4533,22 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + value = new object[] + { + new + { + id = "simple1", + commandLine = "cmd /c dir /s", + }, + new + { + id = "simple2", + commandLine = "cmd /c dir /s", + } + }, +}); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2161,7 +4560,67 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + value = new object[] + { + new + { + id = "complex1", + commandLine = "cmd /c dir /s", + resourceFiles = new object[] + { + new + { + autoStorageContainerName = "containerName", + filePath = "data", + } + }, + environmentSettings = new object[] + { + new + { + name = "env1", + value = "value1", + }, + new + { + name = "env2", + value = "value2", + } + }, + affinityInfo = new + { + affinityId = "affinityId", + }, + constraints = new + { + maxWallClockTime = "P1D", + retentionTime = "P2D", + maxTaskRetryCount = 5, + }, + requiredSlots = 2, + multiInstanceSettings = new + { + numberOfInstances = 3, + coordinationCommandLine = "cmd /c echo coordinating", + commonResourceFiles = new object[] + { + new + { + httpUrl = "https://common.blob.core.windows.net/", + filePath = "common.exe", + } + }, + }, + }, + new + { + id = "simple3", + commandLine = "cmd /c dir /s", + } + }, +}); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2176,7 +4635,22 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + value = new object[] + { + new + { + id = "simple1", + commandLine = "cmd /c dir /s", + }, + new + { + id = "simple2", + commandLine = "cmd /c dir /s", + } + }, +}); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2188,7 +4662,67 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + value = new object[] + { + new + { + id = "complex1", + commandLine = "cmd /c dir /s", + resourceFiles = new object[] + { + new + { + autoStorageContainerName = "containerName", + filePath = "data", + } + }, + environmentSettings = new object[] + { + new + { + name = "env1", + value = "value1", + }, + new + { + name = "env2", + value = "value2", + } + }, + affinityInfo = new + { + affinityId = "affinityId", + }, + constraints = new + { + maxWallClockTime = "P1D", + retentionTime = "P2D", + maxTaskRetryCount = 5, + }, + requiredSlots = 2, + multiInstanceSettings = new + { + numberOfInstances = 3, + coordinationCommandLine = "cmd /c echo coordinating", + commonResourceFiles = new object[] + { + new + { + httpUrl = "https://common.blob.core.windows.net/", + filePath = "common.exe", + } + }, + }, + }, + new + { + id = "simple3", + commandLine = "cmd /c dir /s", + } + }, +}); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2491,7 +5025,12 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); +BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") +{ + IsAdmin = false, + ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), + Password = "Password", +}; Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", user); ]]> @@ -2503,7 +5042,12 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); +BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") +{ + IsAdmin = false, + ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), + Password = "Password", +}; Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", user); ]]> @@ -2515,7 +5059,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + name = "userName", + isAdmin = false, + expiryTime = "2017-08-01T00:00:00Z", + password = "Password", +}); Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -2529,7 +5079,13 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + name = "userName", + isAdmin = false, + expiryTime = "2017-08-01T00:00:00Z", + password = "Password", +}); Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -2569,7 +5125,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); +BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent +{ + Password = "12345", + ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), +}; Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); ]]> @@ -2581,7 +5141,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); +BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent +{ + Password = "12345", + ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), +}; Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); ]]> @@ -2593,7 +5157,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + password = "12345", + expiryTime = "2016-11-27T00:45:48.7320857Z", +}); Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -2607,7 +5175,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + password = "12345", + expiryTime = "2016-11-27T00:45:48.7320857Z", +}); Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -2849,7 +5421,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); +UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); ]]> @@ -2861,7 +5433,7 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); +UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); ]]> @@ -2873,7 +5445,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", + startTime = "2017-11-27T00:00:00Z", +}); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2889,7 +5465,11 @@ Uri endpoint = new Uri(""); TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); -using RequestContent content = RequestContent.Create(new object()); +using RequestContent content = RequestContent.Create(new +{ + containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", + startTime = "2017-11-27T00:00:00Z", +}); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; diff --git a/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs b/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs index 30ce0376ee756..274be47c20ed9 100644 --- a/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs +++ b/sdk/batch/Azure.Compute.Batch/tests/Generated/Samples/Samples_BatchClient.cs @@ -80,7 +80,27 @@ public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool01", + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, + networkConfiguration = new + { + enableAcceleratedNetworking = true, + }, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -94,7 +114,27 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool01", + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, + networkConfiguration = new + { + enableAcceleratedNetworking = true, + }, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -108,7 +148,21 @@ public void Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking_Conve TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TargetDedicatedNodes = 2, + NetworkConfiguration = new NetworkConfiguration + { + EnableAcceleratedNetworking = true, + }, + }; Response response = client.CreatePool(pool); } @@ -120,7 +174,21 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithAcceleratedNetworking TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool01", "Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TargetDedicatedNodes = 2, + NetworkConfiguration = new NetworkConfiguration + { + EnableAcceleratedNetworking = true, + }, + }; Response response = await client.CreatePoolAsync(pool); } @@ -132,7 +200,74 @@ public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + mountConfiguration = new object[] + { +new +{ +azureBlobFileSystemConfiguration = new +{ +accountName = "accountName", +containerName = "blobContainerName", +accountKey = "accountKey", +relativeMountPath = "bfusepath", +}, +}, +new +{ +azureFileShareConfiguration = new +{ +accountName = "accountName", +azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", +accountKey = "accountKey", +relativeMountPath = "filesharepath", +mountOptions = "mount options ver=1.0", +}, +}, +new +{ +nfsMountConfiguration = new +{ +source = "somesource nfs url", +relativeMountPath = "mountpath", +mountOptions = "mount options ver=1.0", +}, +}, +new +{ +cifsMountConfiguration = new +{ +username = "accountName", +password = "password", +source = "//myaccount.file.core.windows.net/file", +relativeMountPath = "mountpath", +mountOptions = "mount options ver=1.0", +}, +} + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -146,7 +281,74 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_A TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + mountConfiguration = new object[] + { +new +{ +azureBlobFileSystemConfiguration = new +{ +accountName = "accountName", +containerName = "blobContainerName", +accountKey = "accountKey", +relativeMountPath = "bfusepath", +}, +}, +new +{ +azureFileShareConfiguration = new +{ +accountName = "accountName", +azureFileUrl = "https://myaccount.file.core.windows.net/fileshare", +accountKey = "accountKey", +relativeMountPath = "filesharepath", +mountOptions = "mount options ver=1.0", +}, +}, +new +{ +nfsMountConfiguration = new +{ +source = "somesource nfs url", +relativeMountPath = "mountpath", +mountOptions = "mount options ver=1.0", +}, +}, +new +{ +cifsMountConfiguration = new +{ +username = "accountName", +password = "password", +source = "//myaccount.file.core.windows.net/file", +relativeMountPath = "mountpath", +mountOptions = "mount options ver=1.0", +}, +} + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -160,7 +362,46 @@ public void Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_Conveni TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + MountConfiguration = {new MountConfiguration +{ +AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") +{ +AccountKey = "accountKey", +}, +}, new MountConfiguration +{ +AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") +{ +MountOptions = "mount options ver=1.0", +}, +}, new MountConfiguration +{ +NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") +{ +MountOptions = "mount options ver=1.0", +}, +}, new MountConfiguration +{ +CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") +{ +MountOptions = "mount options ver=1.0", +}, +}}, + }; Response response = client.CreatePool(pool); } @@ -172,7 +413,46 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithMountDriveSpecified_C TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + MountConfiguration = {new MountConfiguration +{ +AzureBlobFileSystemConfiguration = new AzureBlobFileSystemConfiguration("accountName", "blobContainerName", "bfusepath") +{ +AccountKey = "accountKey", +}, +}, new MountConfiguration +{ +AzureFileShareConfiguration = new AzureFileShareConfiguration("accountName", "https://myaccount.file.core.windows.net/fileshare", "accountKey", "filesharepath") +{ +MountOptions = "mount options ver=1.0", +}, +}, new MountConfiguration +{ +NfsMountConfiguration = new NfsMountConfiguration("somesource nfs url", "mountpath") +{ +MountOptions = "mount options ver=1.0", +}, +}, new MountConfiguration +{ +CifsMountConfiguration = new CifsMountConfiguration("accountName", "//myaccount.file.core.windows.net/file", "mountpath", "password") +{ +MountOptions = "mount options ver=1.0", +}, +}}, + }; Response response = await client.CreatePoolAsync(pool); } @@ -184,7 +464,39 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool001", + vmSize = "standard_d2s_v3", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + osDisk = new + { + diskSizeGB = 100, + managedDisk = new + { + storageAccountType = "standardssd_lrs", + }, + caching = "readwrite", + ephemeralOSDiskSettings = new + { + placement = "cachedisk", + }, + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 1, + enableAutoScale = false, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -198,7 +510,39 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool001", + vmSize = "standard_d2s_v3", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + osDisk = new + { + diskSizeGB = 100, + managedDisk = new + { + storageAccountType = "standardssd_lrs", + }, + caching = "readwrite", + ephemeralOSDiskSettings = new + { + placement = "cachedisk", + }, + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 1, + enableAutoScale = false, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -212,7 +556,32 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + OsDisk = new OSDisk + { + EphemeralOSDiskSettings = new DiffDiskSettings + { + Placement = DiffDiskPlacement.CacheDisk, + }, + Caching = CachingType.ReadWrite, + DiskSizeGB = 100, + ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 1, + }; Response response = client.CreatePool(pool); } @@ -224,7 +593,32 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "standard_d2s_v3") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + OsDisk = new OSDisk + { + EphemeralOSDiskSettings = new DiffDiskSettings + { + Placement = DiffDiskPlacement.CacheDisk, + }, + Caching = CachingType.ReadWrite, + DiskSizeGB = 100, + ManagedDisk = new ManagedDisk(StorageAccountType.StandardSSDLRS), + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 1, + }; Response response = await client.CreatePoolAsync(pool); } @@ -236,7 +630,28 @@ public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + }, + targetDedicatedNodes = 1, + resourceTags = new + { + TagName1 = "TagValue1", + TagName2 = "TagValue2", + }, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -250,7 +665,28 @@ public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_As TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + }, + targetDedicatedNodes = 1, + resourceTags = new + { + TagName1 = "TagValue1", + TagName2 = "TagValue2", + }, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -264,7 +700,22 @@ public void Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Convenie TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04"), + ResourceTags = +{ +["TagName1"] = "TagValue1", +["TagName2"] = "TagValue2" +}, + TargetDedicatedNodes = 1, + }; Response response = client.CreatePool(pool); } @@ -276,7 +727,22 @@ public async Task Example_Batch_CreatePool_CreatesASimplePoolWithResourceTags_Co TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04"), + ResourceTags = +{ +["TagName1"] = "TagValue1", +["TagName2"] = "TagValue2" +}, + TargetDedicatedNodes = 1, + }; Response response = await client.CreatePoolAsync(pool); } @@ -288,7 +754,32 @@ public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + securityProfile = new + { + securityType = "trustedLaunch", + encryptionAtHost = true, + uefiSettings = new + { + secureBootEnabled = false, + }, + }, + }, + targetDedicatedNodes = 1, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -302,7 +793,32 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Async TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool001", + vmSize = "STANDARD_DC2s_V2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "UbuntuServer", + sku = "18_04-lts-gen2", + version = "latest", + }, + nodeAgentSKUId = "batch.node.ubuntu 18.04", + securityProfile = new + { + securityType = "trustedLaunch", + encryptionAtHost = true, + uefiSettings = new + { + secureBootEnabled = false, + }, + }, + }, + targetDedicatedNodes = 1, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -316,7 +832,23 @@ public void Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Convenience TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04") + { + SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings + { + SecureBootEnabled = false, + }), + }, + TargetDedicatedNodes = 1, + }; Response response = client.CreatePool(pool); } @@ -328,7 +860,23 @@ public async Task Example_Batch_CreatePool_CreatesAPoolWithSecurityProfile_Conve TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool001", "STANDARD_DC2s_V2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "UbuntuServer", + Sku = "18_04-lts-gen2", + Version = "latest", + }, "batch.node.ubuntu 18.04") + { + SecurityProfile = new SecurityProfile(true, SecurityTypes.TrustedLaunch, new UefiSettings + { + SecureBootEnabled = false, + }), + }, + TargetDedicatedNodes = 1, + }; Response response = await client.CreatePoolAsync(pool); } @@ -340,7 +888,39 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -354,7 +934,39 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -368,7 +980,23 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPool_Con TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, + }; Response response = client.CreatePool(pool); } @@ -380,7 +1008,23 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04"), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, + }; Response response = await client.CreatePoolAsync(pool); } @@ -392,7 +1036,38 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "120_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new object[] + { +"busybox" + }, + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -406,7 +1081,38 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "120_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + containerConfiguration = new + { + type = "dockerCompatible", + containerImageNames = new object[] + { +"busybox" + }, + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -420,7 +1126,27 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "120_04-lts", + }, "batch.node.ubuntu 20.04") + { + ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) + { + ContainerImageNames = { "busybox" }, + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + }; Response response = client.CreatePool(pool); } @@ -432,7 +1158,27 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "120_04-lts", + }, "batch.node.ubuntu 20.04") + { + ContainerConfiguration = new ContainerConfiguration(ContainerType.DockerCompatible) + { + ContainerImageNames = { "busybox" }, + }, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + }; Response response = await client.CreatePoolAsync(pool); } @@ -444,7 +1190,57 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + extensions = new object[] + { +new +{ +name = "batchextension1", +type = "KeyVaultForLinux", +publisher = "Microsoft.Azure.KeyVault", +typeHandlerVersion = "2.0", +autoUpgradeMinorVersion = true, +enableAutomaticUpgrade = true, +settings = new +{ +secretsManagementSettingsKey = "secretsManagementSettingsValue", +authenticationSettingsKey = "authenticationSettingsValue", +}, +} + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + targetNodeCommunicationMode = "simplified", + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -458,7 +1254,57 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "pool2", + vmSize = "standard_a1", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "Canonical", + offer = "0001-com-ubuntu-server-focal", + sku = "20_04-lts", + }, + nodeAgentSKUId = "batch.node.ubuntu 20.04", + extensions = new object[] + { +new +{ +name = "batchextension1", +type = "KeyVaultForLinux", +publisher = "Microsoft.Azure.KeyVault", +typeHandlerVersion = "2.0", +autoUpgradeMinorVersion = true, +enableAutomaticUpgrade = true, +settings = new +{ +secretsManagementSettingsKey = "secretsManagementSettingsValue", +authenticationSettingsKey = "authenticationSettingsValue", +}, +} + }, + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 5, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 3, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + targetNodeCommunicationMode = "simplified", + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -472,7 +1318,37 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") +{ +TypeHandlerVersion = "2.0", +AutoUpgradeMinorVersion = true, +EnableAutomaticUpgrade = true, +Settings = +{ +["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", +["authenticationSettingsKey"] = "authenticationSettingsValue" +}, +}}, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, + }; Response response = client.CreatePool(pool); } @@ -484,7 +1360,37 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("pool2", "standard_a1") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "Canonical", + Offer = "0001-com-ubuntu-server-focal", + Sku = "20_04-lts", + }, "batch.node.ubuntu 20.04") + { + Extensions = {new VMExtension("batchextension1", "Microsoft.Azure.KeyVault", "KeyVaultForLinux") +{ +TypeHandlerVersion = "2.0", +AutoUpgradeMinorVersion = true, +EnableAutomaticUpgrade = true, +Settings = +{ +["secretsManagementSettingsKey"] = "secretsManagementSettingsValue", +["authenticationSettingsKey"] = "authenticationSettingsValue" +}, +}}, + }, + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 5, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + TaskSlotsPerNode = 3, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Simplified, + }; Response response = await client.CreatePoolAsync(pool); } @@ -496,7 +1402,31 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool002", + vmSize = "Standard_A1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + serviceArtifactReference = new + { + id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, + }); Response response = client.CreatePool(content); Console.WriteLine(response.Status); @@ -510,7 +1440,31 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "mypool002", + vmSize = "Standard_A1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + windowsConfiguration = new + { + enableAutomaticUpdates = false, + }, + serviceArtifactReference = new + { + id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + targetDedicatedNodes = 2, + }); Response response = await client.CreatePoolAsync(content); Console.WriteLine(response.Status); @@ -524,7 +1478,24 @@ public void Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPoolWith TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), + }, + TargetDedicatedNodes = 2, + }; Response response = client.CreatePool(pool); } @@ -536,7 +1507,24 @@ public async Task Example_Batch_CreatePool_CreatesAVirtualMachineConfigurationPo TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolCreateContent pool = new BatchPoolCreateContent(null, null); + BatchPoolCreateContent pool = new BatchPoolCreateContent("mypool002", "Standard_A1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64") + { + WindowsConfiguration = new WindowsConfiguration + { + EnableAutomaticUpdates = false, + }, + ServiceArtifactReference = new ServiceArtifactReference("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/vmArtifactsProfile"), + }, + TargetDedicatedNodes = 2, + }; Response response = await client.CreatePoolAsync(pool); } @@ -874,7 +1862,13 @@ public void Example_Batch_UpdatePool_PatchThePool() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, + }); Response response = client.UpdatePool("poolId", content); Console.WriteLine(response.Status); @@ -888,7 +1882,13 @@ public async Task Example_Batch_UpdatePool_PatchThePool_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, + }); Response response = await client.UpdatePoolAsync("poolId", content); Console.WriteLine(response.Status); @@ -928,7 +1928,11 @@ public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + autoScaleFormula = "$TargetDedicated=0", + autoScaleEvaluationInterval = "PT8M", + }); Response response = client.EnablePoolAutoScale("poolId", content); Console.WriteLine(response.Status); @@ -942,7 +1946,11 @@ public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + autoScaleFormula = "$TargetDedicated=0", + autoScaleEvaluationInterval = "PT8M", + }); Response response = await client.EnablePoolAutoScaleAsync("poolId", content); Console.WriteLine(response.Status); @@ -956,7 +1964,11 @@ public void Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); + BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent + { + AutoScaleFormula = "$TargetDedicated=0", + AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), + }; Response response = client.EnablePoolAutoScale("poolId", content); } @@ -968,7 +1980,11 @@ public async Task Example_Batch_EnablePoolAutoScale_PoolEnableAutoscale_Convenie TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent(); + BatchPoolEnableAutoScaleContent content = new BatchPoolEnableAutoScaleContent + { + AutoScaleFormula = "$TargetDedicated=0", + AutoScaleEvaluationInterval = XmlConvert.ToTimeSpan("PT8M"), + }; Response response = await client.EnablePoolAutoScaleAsync("poolId", content); } @@ -980,7 +1996,10 @@ public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + autoScaleFormula = "$TargetDedicated=1", + }); Response response = client.EvaluatePoolAutoScale("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -995,7 +2014,10 @@ public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Asyn TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + autoScaleFormula = "$TargetDedicated=1", + }); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -1010,7 +2032,7 @@ public void Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Convenienc TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); + BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); Response response = client.EvaluatePoolAutoScale("poolId", content); } @@ -1022,7 +2044,7 @@ public async Task Example_Batch_EvaluatePoolAutoScale_PoolEvaluateAutoscale_Conv TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent(null); + BatchPoolEvaluateAutoScaleContent content = new BatchPoolEvaluateAutoScaleContent("$TargetDedicated=1"); Response response = await client.EvaluatePoolAutoScaleAsync("poolId", content); } @@ -1034,7 +2056,11 @@ public void Example_Batch_ResizePool_PoolResize() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, + }); Response response = client.ResizePool("resizePool", content); Console.WriteLine(response.Status); @@ -1048,7 +2074,11 @@ public async Task Example_Batch_ResizePool_PoolResize_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + targetDedicatedNodes = 1, + targetLowPriorityNodes = 0, + }); Response response = await client.ResizePoolAsync("resizePool", content); Console.WriteLine(response.Status); @@ -1062,7 +2092,11 @@ public void Example_Batch_ResizePool_PoolResize_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolResizeContent content = new BatchPoolResizeContent(); + BatchPoolResizeContent content = new BatchPoolResizeContent + { + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, + }; Response response = client.ResizePool("resizePool", content); } @@ -1074,7 +2108,11 @@ public async Task Example_Batch_ResizePool_PoolResize_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolResizeContent content = new BatchPoolResizeContent(); + BatchPoolResizeContent content = new BatchPoolResizeContent + { + TargetDedicatedNodes = 1, + TargetLowPriorityNodes = 0, + }; Response response = await client.ResizePoolAsync("resizePool", content); } @@ -1112,7 +2150,15 @@ public void Example_Batch_ReplacePoolProperties_PoolUpdate() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, + applicationPackageReferences = Array.Empty(), + metadata = Array.Empty(), + }); Response response = client.ReplacePoolProperties("poolId", content); Console.WriteLine(response.Status); @@ -1126,7 +2172,15 @@ public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + startTask = new + { + commandLine = "/bin/bash -c 'echo start task'", + }, + applicationPackageReferences = Array.Empty(), + metadata = Array.Empty(), + }); Response response = await client.ReplacePoolPropertiesAsync("poolId", content); Console.WriteLine(response.Status); @@ -1140,7 +2194,10 @@ public void Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); + BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) + { + StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), + }; Response response = client.ReplacePoolProperties("poolId", pool); } @@ -1152,7 +2209,10 @@ public async Task Example_Batch_ReplacePoolProperties_PoolUpdate_Convenience_Asy TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchPoolReplaceContent pool = new BatchPoolReplaceContent(null, null); + BatchPoolReplaceContent pool = new BatchPoolReplaceContent(Array.Empty(), Array.Empty()) + { + StartTask = new BatchStartTask("/bin/bash -c 'echo start task'"), + }; Response response = await client.ReplacePoolPropertiesAsync("poolId", pool); } @@ -1164,7 +2224,14 @@ public void Example_Batch_RemoveNodes_PoolRemoveNodes() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + nodeList = new object[] + { +"tvm-1695681911_1-20161122t224741z", +"tvm-1695681911_2-20161122t224741z" + }, + }); Response response = client.RemoveNodes("poolId", content); Console.WriteLine(response.Status); @@ -1178,7 +2245,14 @@ public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + nodeList = new object[] + { +"tvm-1695681911_1-20161122t224741z", +"tvm-1695681911_2-20161122t224741z" + }, + }); Response response = await client.RemoveNodesAsync("poolId", content); Console.WriteLine(response.Status); @@ -1192,7 +2266,7 @@ public void Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); + BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); Response response = client.RemoveNodes("poolId", content); } @@ -1204,7 +2278,7 @@ public async Task Example_Batch_RemoveNodes_PoolRemoveNodes_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeRemoveContent content = new BatchNodeRemoveContent(null); + BatchNodeRemoveContent content = new BatchNodeRemoveContent(new string[] { "tvm-1695681911_1-20161122t224741z", "tvm-1695681911_2-20161122t224741z" }); Response response = await client.RemoveNodesAsync("poolId", content); } @@ -1292,7 +2366,19 @@ public void Example_Batch_UpdateJob_JobPatch() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + poolInfo = new + { + poolId = "poolId", + }, + }); Response response = client.UpdateJob("jobId", content); Console.WriteLine(response.Status); @@ -1306,7 +2392,19 @@ public async Task Example_Batch_UpdateJob_JobPatch_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + poolInfo = new + { + poolId = "poolId", + }, + }); Response response = await client.UpdateJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -1418,7 +2516,10 @@ public void Example_Batch_DisableJob_JobDisable() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + disableTasks = "terminate", + }); Response response = client.DisableJob("jobId", content); Console.WriteLine(response.Status); @@ -1432,7 +2533,10 @@ public async Task Example_Batch_DisableJob_JobDisable_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + disableTasks = "terminate", + }); Response response = await client.DisableJobAsync("jobId", content); Console.WriteLine(response.Status); @@ -1446,7 +2550,7 @@ public void Example_Batch_DisableJob_JobDisable_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobDisableContent content = new BatchJobDisableContent(default); + BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); Response response = client.DisableJob("jobId", content); } @@ -1458,7 +2562,7 @@ public async Task Example_Batch_DisableJob_JobDisable_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobDisableContent content = new BatchJobDisableContent(default); + BatchJobDisableContent content = new BatchJobDisableContent(DisableBatchJobOption.Terminate); Response response = await client.DisableJobAsync("jobId", content); } @@ -1546,7 +2650,15 @@ public void Example_Batch_CreateJob_CreatesABasicJob() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobId", + priority = 0, + poolInfo = new + { + poolId = "poolId", + }, + }); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -1560,7 +2672,15 @@ public async Task Example_Batch_CreateJob_CreatesABasicJob_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobId", + priority = 0, + poolInfo = new + { + poolId = "poolId", + }, + }); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -1574,7 +2694,13 @@ public void Example_Batch_CreateJob_CreatesABasicJob_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobCreateContent job = new BatchJobCreateContent(null, null); + BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo + { + PoolId = "poolId", + }) + { + Priority = 0, + }; Response response = client.CreateJob(job); } @@ -1586,7 +2712,13 @@ public async Task Example_Batch_CreateJob_CreatesABasicJob_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobCreateContent job = new BatchJobCreateContent(null, null); + BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo + { + PoolId = "poolId", + }) + { + Priority = 0, + }; Response response = await client.CreateJobAsync(job); } @@ -1598,7 +2730,139 @@ public void Example_Batch_CreateJob_CreatesAComplexJob() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobId", + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "taskId", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +filePath = "myprogram.exe", +}, +new +{ +storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", +filePath = "datafolder", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = false, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "job", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +filePath = "myprogram2.exe", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + }); Response response = client.CreateJob(content); Console.WriteLine(response.Status); @@ -1612,7 +2876,139 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobId", + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "taskId", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +filePath = "myprogram.exe", +}, +new +{ +storageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", +filePath = "datafolder", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = false, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "job", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +filePath = "myprogram2.exe", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + }); Response response = await client.CreateJobAsync(content); Console.WriteLine(response.Status); @@ -1626,7 +3022,96 @@ public void Example_Batch_CreateJob_CreatesAComplexJob_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobCreateContent job = new BatchJobCreateContent(null, null); + BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo + { + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +FilePath = "myprogram2.exe", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, + }) + { + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +FilePath = "myprogram.exe", +}, new ResourceFile +{ +StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", +FilePath = "datafolder", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = false, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + RunExclusive = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + }; Response response = client.CreateJob(job); } @@ -1638,7 +3123,96 @@ public async Task Example_Batch_CreateJob_CreatesAComplexJob_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobCreateContent job = new BatchJobCreateContent(null, null); + BatchJobCreateContent job = new BatchJobCreateContent("jobId", new BatchPoolInfo + { + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.Job) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +FilePath = "myprogram2.exe", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, + }) + { + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("taskId", "myprogram.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +FilePath = "myprogram.exe", +}, new ResourceFile +{ +StorageContainerUrl = "http://mystorage1.blob.core.windows.net/data?sas", +FilePath = "datafolder", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = false, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + RunExclusive = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + }; Response response = await client.CreateJobAsync(job); } @@ -1794,7 +3368,27 @@ public void Example_Batch_UpdateJobSchedule_JobSchedulePatch() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + schedule = new + { + doNotRunUntil = "2025-01-01T12:30:00Z", + }, + jobSpecification = new + { + priority = 0, + usesTaskDependencies = false, + constraints = new + { + maxWallClockTime = "P10675199DT2H48M5.4775807S", + maxTaskRetryCount = 0, + }, + poolInfo = new + { + poolId = "poolId", + }, + }, + }); Response response = client.UpdateJobSchedule("jobScheduleId", content); Console.WriteLine(response.Status); @@ -1808,7 +3402,27 @@ public async Task Example_Batch_UpdateJobSchedule_JobSchedulePatch_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + schedule = new + { + doNotRunUntil = "2025-01-01T12:30:00Z", + }, + jobSpecification = new + { + priority = 0, + usesTaskDependencies = false, + constraints = new + { + maxWallClockTime = "P10675199DT2H48M5.4775807S", + maxTaskRetryCount = 0, + }, + poolInfo = new + { + poolId = "poolId", + }, + }, + }); Response response = await client.UpdateJobScheduleAsync("jobScheduleId", content); Console.WriteLine(response.Status); @@ -2028,7 +3642,21 @@ public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobScheduleId", + schedule = new + { + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + poolInfo = new + { + poolId = "poolId", + }, + }, + }); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -2042,7 +3670,21 @@ public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Async TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobScheduleId", + schedule = new + { + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + poolInfo = new + { + poolId = "poolId", + }, + }, + }); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -2056,7 +3698,13 @@ public void Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Convenience TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration + { + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), + }, new BatchJobSpecification(new BatchPoolInfo + { + PoolId = "poolId", + })); Response response = client.CreateJobSchedule(jobSchedule); } @@ -2068,7 +3716,13 @@ public async Task Example_Batch_CreateJobSchedule_CreatesABasicJobSchedule_Conve TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration + { + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), + }, new BatchJobSpecification(new BatchPoolInfo + { + PoolId = "poolId", + })); Response response = await client.CreateJobScheduleAsync(jobSchedule); } @@ -2080,7 +3734,149 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobScheduleId", + schedule = new + { + doNotRunUntil = "2014-09-10T02:30:00.000Z", + doNotRunAfter = "2014-09-10T06:30:00.000Z", + startWindow = "PT1M", + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "mytask1", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +filePath = "myprogram.exe", +}, +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", +filePath = "test.txt", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = true, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "jobschedule", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +filePath = "myprogram2.exe", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + }); Response response = client.CreateJobSchedule(content); Console.WriteLine(response.Status); @@ -2094,7 +3890,149 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "jobScheduleId", + schedule = new + { + doNotRunUntil = "2014-09-10T02:30:00.000Z", + doNotRunAfter = "2014-09-10T06:30:00.000Z", + startWindow = "PT1M", + recurrenceInterval = "PT5M", + }, + jobSpecification = new + { + priority = 100, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = -1, + }, + jobManagerTask = new + { + id = "mytask1", + commandLine = "myprogram.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +filePath = "myprogram.exe", +}, +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", +filePath = "test.txt", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + constraints = new + { + maxWallClockTime = "PT1H", + maxTaskRetryCount = 0, + retentionTime = "PT1H", + }, + requiredSlots = 2, + killJobOnCompletion = true, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + runExclusive = true, + }, + poolInfo = new + { + autoPoolSpecification = new + { + autoPoolIdPrefix = "mypool", + poolLifetimeOption = "jobschedule", + pool = new + { + vmSize = "Standard_D1_v2", + virtualMachineConfiguration = new + { + imageReference = new + { + publisher = "MicrosoftWindowsServer", + offer = "WindowsServer", + sku = "2016-datacenter-smalldisk", + version = "latest", + }, + nodeAgentSKUId = "batch.node.windows amd64", + }, + resizeTimeout = "PT15M", + targetDedicatedNodes = 3, + targetLowPriorityNodes = 0, + taskSlotsPerNode = 2, + taskSchedulingPolicy = new + { + nodeFillType = "spread", + }, + enableAutoScale = false, + enableInterNodeCommunication = true, + startTask = new + { + commandLine = "myprogram2.exe", + resourceFiles = new object[] + { +new +{ +httpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +filePath = "myprogram2.exe", +} + }, + environmentSettings = new object[] + { +new +{ +name = "myvariable", +value = "myvalue", +} + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "admin", + }, + }, + maxTaskRetryCount = 2, + waitForSuccess = true, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + targetNodeCommunicationMode = "default", + }, + }, + }, + }, + metadata = new object[] + { +new +{ +name = "myproperty", +value = "myvalue", +} + }, + }); Response response = await client.CreateJobScheduleAsync(content); Console.WriteLine(response.Status); @@ -2108,7 +4046,104 @@ public void Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_Conven TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration + { + DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), + DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), + StartWindow = XmlConvert.ToTimeSpan("PT1M"), + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), + }, new BatchJobSpecification(new BatchPoolInfo + { + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +FilePath = "myprogram2.exe", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, + }) + { + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +FilePath = "myprogram.exe", +}, new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", +FilePath = "test.txt", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = true, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + RunExclusive = true, + }, + }) + { + Metadata = { new MetadataItem("myproperty", "myvalue") }, + }; Response response = client.CreateJobSchedule(jobSchedule); } @@ -2120,7 +4155,104 @@ public async Task Example_Batch_CreateJobSchedule_CreatesAComplexJobScheduleAdd_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent(null, null, null); + BatchJobScheduleCreateContent jobSchedule = new BatchJobScheduleCreateContent("jobScheduleId", new BatchJobScheduleConfiguration + { + DoNotRunUntil = DateTimeOffset.Parse("2014-09-10T02:30:00.000Z"), + DoNotRunAfter = DateTimeOffset.Parse("2014-09-10T06:30:00.000Z"), + StartWindow = XmlConvert.ToTimeSpan("PT1M"), + RecurrenceInterval = XmlConvert.ToTimeSpan("PT5M"), + }, new BatchJobSpecification(new BatchPoolInfo + { + AutoPoolSpecification = new BatchAutoPoolSpecification(BatchPoolLifetimeOption.JobSchedule) + { + AutoPoolIdPrefix = "mypool", + Pool = new BatchPoolSpecification("Standard_D1_v2") + { + VirtualMachineConfiguration = new VirtualMachineConfiguration(new ImageReference + { + Publisher = "MicrosoftWindowsServer", + Offer = "WindowsServer", + Sku = "2016-datacenter-smalldisk", + Version = "latest", + }, "batch.node.windows amd64"), + TaskSlotsPerNode = 2, + TaskSchedulingPolicy = new BatchTaskSchedulingPolicy(BatchNodeFillType.Spread), + ResizeTimeout = XmlConvert.ToTimeSpan("PT15M"), + TargetDedicatedNodes = 3, + TargetLowPriorityNodes = 0, + EnableAutoScale = false, + EnableInterNodeCommunication = true, + StartTask = new BatchStartTask("myprogram2.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram2.exe?sas", +FilePath = "myprogram2.exe", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.Admin, + }, + }, + MaxTaskRetryCount = 2, + WaitForSuccess = true, + }, + Metadata = { new MetadataItem("myproperty", "myvalue") }, + TargetNodeCommunicationMode = BatchNodeCommunicationMode.Default, + }, + }, + }) + { + Priority = 100, + Constraints = new BatchJobConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = -1, + }, + JobManagerTask = new BatchJobManagerTask("mytask1", "myprogram.exe") + { + ResourceFiles = {new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/myprogram.exe?sas", +FilePath = "myprogram.exe", +}, new ResourceFile +{ +HttpUrl = "http://mystorage1.blob.core.windows.net/scripts/test.txt?sas", +FilePath = "test.txt", +}}, + EnvironmentSettings = {new EnvironmentSetting("myvariable") +{ +Value = "myvalue", +}}, + Constraints = new BatchTaskConstraints + { + MaxWallClockTime = XmlConvert.ToTimeSpan("PT1H"), + RetentionTime = XmlConvert.ToTimeSpan("PT1H"), + MaxTaskRetryCount = 0, + }, + RequiredSlots = 2, + KillJobOnCompletion = true, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + RunExclusive = true, + }, + }) + { + Metadata = { new MetadataItem("myproperty", "myvalue") }, + }; Response response = await client.CreateJobScheduleAsync(jobSchedule); } @@ -2132,7 +4264,11 @@ public void Example_Batch_CreateTask_CreatesABasicTask() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "task1", + commandLine = "cmd /c echo task1", + }); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2146,7 +4282,11 @@ public async Task Example_Batch_CreateTask_CreatesABasicTask_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "task1", + commandLine = "cmd /c echo task1", + }); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2160,7 +4300,7 @@ public void Example_Batch_CreateTask_CreatesABasicTask_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); Response response = client.CreateTask("jobId", task); } @@ -2172,7 +4312,7 @@ public async Task Example_Batch_CreateTask_CreatesABasicTask_Convenience_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1"); Response response = await client.CreateTaskAsync("jobId", task); } @@ -2184,7 +4324,24 @@ public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerRunOptions = "--rm", + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2198,7 +4355,24 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Asy TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "bash -c 'echo hello'", + containerSettings = new + { + imageName = "ubuntu", + containerRunOptions = "--rm", + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2212,7 +4386,21 @@ public void Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Convenien TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") + { + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerRunOptions = "--rm", + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; Response response = client.CreateTask("jobId", task); } @@ -2224,7 +4412,21 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithContainerSettings_Con TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "bash -c 'echo hello'") + { + ContainerSettings = new BatchTaskContainerSettings("ubuntu") + { + ContainerRunOptions = "--rm", + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; Response response = await client.CreateTaskAsync("jobId", task); } @@ -2236,7 +4438,34 @@ public void Example_Batch_CreateTask_CreatesATaskWithExitConditions() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "cmd /c exit 3", + exitConditions = new + { + exitCodeRanges = new object[] + { +new +{ +start = 2, +end = 4, +exitOptions = new +{ +jobAction = "terminate", +}, +} + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2250,7 +4479,34 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Async( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "taskId", + commandLine = "cmd /c exit 3", + exitConditions = new + { + exitCodeRanges = new object[] + { +new +{ +start = 2, +end = 4, +exitOptions = new +{ +jobAction = "terminate", +}, +} + }, + }, + userIdentity = new + { + autoUser = new + { + scope = "task", + elevationLevel = "nonadmin", + }, + }, + }); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2264,7 +4520,24 @@ public void Example_Batch_CreateTask_CreatesATaskWithExitConditions_Convenience( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") + { + ExitConditions = new ExitConditions + { + ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions +{ +JobAction = BatchJobAction.Terminate, +})}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; Response response = client.CreateTask("jobId", task); } @@ -2276,7 +4549,24 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExitConditions_Conven TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("taskId", "cmd /c exit 3") + { + ExitConditions = new ExitConditions + { + ExitCodeRanges = {new ExitCodeRangeMapping(2, 4, new ExitOptions +{ +JobAction = BatchJobAction.Terminate, +})}, + }, + UserIdentity = new UserIdentity + { + AutoUser = new AutoUserSpecification + { + Scope = AutoUserScope.Task, + ElevationLevel = ElevationLevel.NonAdmin, + }, + }, + }; Response response = await client.CreateTaskAsync("jobId", task); } @@ -2288,7 +4578,12 @@ public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "task1", + requiredSlots = 2, + commandLine = "cmd /c echo task1", + }); Response response = client.CreateTask("jobId", content); Console.WriteLine(response.Status); @@ -2302,7 +4597,12 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + id = "task1", + requiredSlots = 2, + commandLine = "cmd /c echo task1", + }); Response response = await client.CreateTaskAsync("jobId", content); Console.WriteLine(response.Status); @@ -2316,7 +4616,10 @@ public void Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_Conven TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") + { + RequiredSlots = 2, + }; Response response = client.CreateTask("jobId", task); } @@ -2328,7 +4631,10 @@ public async Task Example_Batch_CreateTask_CreatesATaskWithExtraSlotRequirement_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskCreateContent task = new BatchTaskCreateContent(null, null); + BatchTaskCreateContent task = new BatchTaskCreateContent("task1", "cmd /c echo task1") + { + RequiredSlots = 2, + }; Response response = await client.CreateTaskAsync("jobId", task); } @@ -2340,7 +4646,22 @@ public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + value = new object[] + { +new +{ +id = "simple1", +commandLine = "cmd /c dir /s", +}, +new +{ +id = "simple2", +commandLine = "cmd /c dir /s", +} + }, + }); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2355,7 +4676,22 @@ public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTa TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + value = new object[] + { +new +{ +id = "simple1", +commandLine = "cmd /c dir /s", +}, +new +{ +id = "simple2", +commandLine = "cmd /c dir /s", +} + }, + }); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2370,7 +4706,11 @@ public void Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTasks_Co TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(null); + BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] + { +new BatchTaskCreateContent("simple1", "cmd /c dir /s"), +new BatchTaskCreateContent("simple2", "cmd /c dir /s") + }); Response response = client.CreateTaskCollection("jobId", taskCollection); } @@ -2382,7 +4722,11 @@ public async Task Example_Batch_CreateTaskCollection_CreatesABasicCollectionOfTa TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(null); + BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] + { +new BatchTaskCreateContent("simple1", "cmd /c dir /s"), +new BatchTaskCreateContent("simple2", "cmd /c dir /s") + }); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); } @@ -2394,7 +4738,67 @@ public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + value = new object[] + { +new +{ +id = "complex1", +commandLine = "cmd /c dir /s", +resourceFiles = new object[] +{ +new +{ +autoStorageContainerName = "containerName", +filePath = "data", +} +}, +environmentSettings = new object[] +{ +new +{ +name = "env1", +value = "value1", +}, +new +{ +name = "env2", +value = "value2", +} +}, +affinityInfo = new +{ +affinityId = "affinityId", +}, +constraints = new +{ +maxWallClockTime = "P1D", +retentionTime = "P2D", +maxTaskRetryCount = 5, +}, +requiredSlots = 2, +multiInstanceSettings = new +{ +numberOfInstances = 3, +coordinationCommandLine = "cmd /c echo coordinating", +commonResourceFiles = new object[] +{ +new +{ +httpUrl = "https://common.blob.core.windows.net/", +filePath = "common.exe", +} +}, +}, +}, +new +{ +id = "simple3", +commandLine = "cmd /c dir /s", +} + }, + }); Response response = client.CreateTaskCollection("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2409,7 +4813,67 @@ public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOf TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + value = new object[] + { +new +{ +id = "complex1", +commandLine = "cmd /c dir /s", +resourceFiles = new object[] +{ +new +{ +autoStorageContainerName = "containerName", +filePath = "data", +} +}, +environmentSettings = new object[] +{ +new +{ +name = "env1", +value = "value1", +}, +new +{ +name = "env2", +value = "value2", +} +}, +affinityInfo = new +{ +affinityId = "affinityId", +}, +constraints = new +{ +maxWallClockTime = "P1D", +retentionTime = "P2D", +maxTaskRetryCount = 5, +}, +requiredSlots = 2, +multiInstanceSettings = new +{ +numberOfInstances = 3, +coordinationCommandLine = "cmd /c echo coordinating", +commonResourceFiles = new object[] +{ +new +{ +httpUrl = "https://common.blob.core.windows.net/", +filePath = "common.exe", +} +}, +}, +}, +new +{ +id = "simple3", +commandLine = "cmd /c dir /s", +} + }, + }); Response response = await client.CreateTaskCollectionAsync("jobId", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -2424,7 +4888,42 @@ public void Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOfTasks_ TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(null); + BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] + { +new BatchTaskCreateContent("complex1", "cmd /c dir /s") +{ +ResourceFiles = {new ResourceFile +{ +AutoStorageContainerName = "containerName", +FilePath = "data", +}}, +EnvironmentSettings = {new EnvironmentSetting("env1") +{ +Value = "value1", +}, new EnvironmentSetting("env2") +{ +Value = "value2", +}}, +AffinityInfo = new AffinityInfo("affinityId"), +Constraints = new BatchTaskConstraints +{ +MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), +RetentionTime = XmlConvert.ToTimeSpan("P2D"), +MaxTaskRetryCount = 5, +}, +RequiredSlots = 2, +MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") +{ +NumberOfInstances = 3, +CommonResourceFiles = {new ResourceFile +{ +HttpUrl = "https://common.blob.core.windows.net/", +FilePath = "common.exe", +}}, +}, +}, +new BatchTaskCreateContent("simple3", "cmd /c dir /s") + }); Response response = client.CreateTaskCollection("jobId", taskCollection); } @@ -2436,7 +4935,42 @@ public async Task Example_Batch_CreateTaskCollection_CreatesAComplexCollectionOf TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchTaskGroup taskCollection = new BatchTaskGroup(null); + BatchTaskGroup taskCollection = new BatchTaskGroup(new BatchTaskCreateContent[] + { +new BatchTaskCreateContent("complex1", "cmd /c dir /s") +{ +ResourceFiles = {new ResourceFile +{ +AutoStorageContainerName = "containerName", +FilePath = "data", +}}, +EnvironmentSettings = {new EnvironmentSetting("env1") +{ +Value = "value1", +}, new EnvironmentSetting("env2") +{ +Value = "value2", +}}, +AffinityInfo = new AffinityInfo("affinityId"), +Constraints = new BatchTaskConstraints +{ +MaxWallClockTime = XmlConvert.ToTimeSpan("P1D"), +RetentionTime = XmlConvert.ToTimeSpan("P2D"), +MaxTaskRetryCount = 5, +}, +RequiredSlots = 2, +MultiInstanceSettings = new MultiInstanceSettings("cmd /c echo coordinating") +{ +NumberOfInstances = 3, +CommonResourceFiles = {new ResourceFile +{ +HttpUrl = "https://common.blob.core.windows.net/", +FilePath = "common.exe", +}}, +}, +}, +new BatchTaskCreateContent("simple3", "cmd /c dir /s") + }); Response response = await client.CreateTaskCollectionAsync("jobId", taskCollection); } @@ -2736,7 +5270,13 @@ public void Example_Batch_CreateNodeUser_NodeCreateUser() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + name = "userName", + isAdmin = false, + expiryTime = "2017-08-01T00:00:00Z", + password = "Password", + }); Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -2750,7 +5290,13 @@ public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + name = "userName", + isAdmin = false, + expiryTime = "2017-08-01T00:00:00Z", + password = "Password", + }); Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); Console.WriteLine(response.Status); @@ -2764,7 +5310,12 @@ public void Example_Batch_CreateNodeUser_NodeCreateUser_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); + BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") + { + IsAdmin = false, + ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), + Password = "Password", + }; Response response = client.CreateNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", user); } @@ -2776,7 +5327,12 @@ public async Task Example_Batch_CreateNodeUser_NodeCreateUser_Convenience_Async( TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserCreateContent user = new BatchNodeUserCreateContent(null); + BatchNodeUserCreateContent user = new BatchNodeUserCreateContent("userName") + { + IsAdmin = false, + ExpiryTime = DateTimeOffset.Parse("2017-08-01T00:00:00Z"), + Password = "Password", + }; Response response = await client.CreateNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", user); } @@ -2814,7 +5370,11 @@ public void Example_Batch_ReplaceNodeUser_NodeUpdateUser() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + password = "12345", + expiryTime = "2016-11-27T00:45:48.7320857Z", + }); Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -2828,7 +5388,11 @@ public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + password = "12345", + expiryTime = "2016-11-27T00:45:48.7320857Z", + }); Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); Console.WriteLine(response.Status); @@ -2842,7 +5406,11 @@ public void Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); + BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent + { + Password = "12345", + ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), + }; Response response = client.ReplaceNodeUser("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); } @@ -2854,7 +5422,11 @@ public async Task Example_Batch_ReplaceNodeUser_NodeUpdateUser_Convenience_Async TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent(); + BatchNodeUserUpdateContent content = new BatchNodeUserUpdateContent + { + Password = "12345", + ExpiryTime = DateTimeOffset.Parse("2016-11-27T00:45:48.7320857Z"), + }; Response response = await client.ReplaceNodeUserAsync("poolId", "tvm-1695681911_1-20161121t182739z", "userName", content); } @@ -3094,7 +5666,11 @@ public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", + startTime = "2017-11-27T00:00:00Z", + }); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -3110,7 +5686,11 @@ public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Async() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - using RequestContent content = RequestContent.Create(new object()); + using RequestContent content = RequestContent.Create(new + { + containerUrl = "https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", + startTime = "2017-11-27T00:00:00Z", + }); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; @@ -3126,7 +5706,7 @@ public void Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenience() TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); + UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); Response response = client.UploadNodeLogs("poolId", "tvm-1695681911_1-20161121t182739z", content); } @@ -3138,7 +5718,7 @@ public async Task Example_Batch_UploadNodeLogs_UploadBatchServiceLogs_Convenienc TokenCredential credential = new DefaultAzureCredential(); BatchClient client = new BatchClient(endpoint, credential); - UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent(null, default); + UploadBatchServiceLogsContent content = new UploadBatchServiceLogsContent("https://somestorageacct.blob.core.windows.net/batch-compute-node-logs?se=2017-12-09T18%3A51%3A00Z&sp=w&sv=2016-05-31&sr=c&sig", DateTimeOffset.Parse("2017-11-27T00:00:00Z")); Response response = await client.UploadNodeLogsAsync("poolId", "tvm-1695681911_1-20161121t182739z", content); }