diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 3385ef58b006..513c3c51b6b7 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3527,6 +3527,11 @@ packages: uri-js: 4.4.1 dev: false + /ansi-colors@3.2.3: + resolution: {integrity: sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==} + engines: {node: '>=6'} + dev: false + /ansi-colors@4.1.1: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} engines: {node: '>=6'} @@ -3544,6 +3549,11 @@ packages: engines: {node: '>=4'} dev: false + /ansi-regex@4.1.1: + resolution: {integrity: sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==} + engines: {node: '>=6'} + dev: false + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -3664,6 +3674,17 @@ packages: es-shim-unscopables: 1.0.0 dev: false + /array.prototype.reduce@1.0.6: + resolution: {integrity: sha512-UW+Mz8LG/sPSU8jRDCjVr6J/ZKAGpHfwrZ6kWTG5qCxIEiXdVshqGnu5vEZA8S1y6X4aCSbQZ0/EEsfvEvBiSg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + es-array-method-boxes-properly: 1.0.0 + is-string: 1.0.7 + dev: false + /arraybuffer.prototype.slice@1.0.1: resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} engines: {node: '>= 0.4'} @@ -4010,6 +4031,21 @@ packages: resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} dev: false + /chokidar@3.3.0: + resolution: {integrity: sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.3 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.2.0 + optionalDependencies: + fsevents: 2.1.3 + dev: false + /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -4064,6 +4100,14 @@ packages: engines: {node: '>= 10'} dev: false + /cliui@5.0.0: + resolution: {integrity: sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==} + dependencies: + string-width: 3.1.0 + strip-ansi: 5.2.0 + wrap-ansi: 5.1.0 + dev: false + /cliui@6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: @@ -4320,6 +4364,13 @@ packages: ms: 2.0.0 dev: false + /debug@3.2.6: + resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} + deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) + dependencies: + ms: 2.1.3 + dev: false + /debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} dependencies: @@ -4489,6 +4540,11 @@ packages: resolution: {integrity: sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==} dev: false + /diff@3.5.0: + resolution: {integrity: sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==} + engines: {node: '>=0.3.1'} + dev: false + /diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} @@ -4579,6 +4635,10 @@ packages: resolution: {integrity: sha512-LF2IQit4B0VrUHFeQkWhZm97KuJSGF2WJqq1InpY+ECpFRkXd8yTIaTtJxsO0OKDmiBYwWqcrNaXOurn2T2wiA==} dev: false + /emoji-regex@7.0.3: + resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} + dev: false + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: false @@ -4687,6 +4747,10 @@ packages: which-typed-array: 1.1.11 dev: false + /es-array-method-boxes-properly@1.0.0: + resolution: {integrity: sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==} + dev: false + /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} @@ -5367,6 +5431,13 @@ packages: pkg-dir: 4.2.0 dev: false + /find-up@3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + dependencies: + locate-path: 3.0.0 + dev: false + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -5392,6 +5463,13 @@ packages: rimraf: 3.0.2 dev: false + /flat@4.1.1: + resolution: {integrity: sha512-FmTtBsHskrU6FJ2VxCnsDb84wu9zhmO3cUX2kGFb5tuwhfXxGciiT0oRY+cck35QmG+NmGh5eLz6lLCpWTqwpA==} + hasBin: true + dependencies: + is-buffer: 2.0.5 + dev: false + /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} hasBin: true @@ -5523,6 +5601,15 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: false + /fsevents@2.1.3: + resolution: {integrity: sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + deprecated: '"Please update to latest v2.3 or v2.2"' + requiresBuild: true + dev: false + optional: true + /fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -5639,6 +5726,17 @@ packages: path-scurry: 1.10.1 dev: false + /glob@7.1.3: + resolution: {integrity: sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: false + /glob@7.2.0: resolution: {integrity: sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==} dependencies: @@ -5738,6 +5836,11 @@ packages: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: false + /growl@1.10.5: + resolution: {integrity: sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==} + engines: {node: '>=4.x'} + dev: false + /guid-typescript@1.0.9: resolution: {integrity: sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ==} dev: false @@ -6071,6 +6174,11 @@ packages: engines: {node: '>=0.10.0'} dev: false + /is-fullwidth-code-point@2.0.0: + resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} + engines: {node: '>=4'} + dev: false + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} @@ -6336,6 +6444,14 @@ packages: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: false + /js-yaml@3.13.1: + resolution: {integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: false + /js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -6716,6 +6832,14 @@ packages: strip-bom: 3.0.0 dev: false + /locate-path@3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + dev: false + /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -6761,6 +6885,13 @@ packages: chalk: 2.4.2 dev: false + /log-symbols@3.0.0: + resolution: {integrity: sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==} + engines: {node: '>=8'} + dependencies: + chalk: 2.4.2 + dev: false + /log-symbols@4.1.0: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} @@ -7010,6 +7141,12 @@ packages: dom-walk: 0.1.2 dev: false + /minimatch@3.0.4: + resolution: {integrity: sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==} + dependencies: + brace-expansion: 1.1.11 + dev: false + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -7073,6 +7210,13 @@ packages: resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} dev: false + /mkdirp@0.5.5: + resolution: {integrity: sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==} + hasBin: true + dependencies: + minimist: 1.2.8 + dev: false + /mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -7159,6 +7303,37 @@ packages: yargs-unparser: 2.0.0 dev: false + /mocha@7.2.0: + resolution: {integrity: sha512-O9CIypScywTVpNaRrCAgoUnJgozpIofjKUYmJhiCIJMiuYnLI6otcb1/kpW9/n/tJODHGZ7i8aLQoDVsMtOKQQ==} + engines: {node: '>= 8.10.0'} + hasBin: true + dependencies: + ansi-colors: 3.2.3 + browser-stdout: 1.3.1 + chokidar: 3.3.0 + debug: 3.2.6 + diff: 3.5.0 + escape-string-regexp: 1.0.5 + find-up: 3.0.0 + glob: 7.1.3 + growl: 1.10.5 + he: 1.2.0 + js-yaml: 3.13.1 + log-symbols: 3.0.0 + minimatch: 3.0.4 + mkdirp: 0.5.5 + ms: 2.1.1 + node-environment-flags: 1.0.6 + object.assign: 4.1.0 + strip-json-comments: 2.0.1 + supports-color: 6.0.0 + which: 1.3.1 + wide-align: 1.1.3 + yargs: 13.3.2 + yargs-parser: 13.1.2 + yargs-unparser: 1.6.0 + dev: false + /mock-socket@9.2.1: resolution: {integrity: sha512-aw9F9T9G2zpGipLLhSNh6ZpgUyUl4frcVmRN08uE1NWPWg43Wx6+sGPDbQ7E5iFZZDJW5b5bypMeAEHqTbIFag==} engines: {node: '>= 8'} @@ -7180,6 +7355,10 @@ packages: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: false + /ms@2.1.1: + resolution: {integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==} + dev: false + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: false @@ -7270,6 +7449,13 @@ packages: engines: {node: '>=10.5.0'} dev: false + /node-environment-flags@1.0.6: + resolution: {integrity: sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==} + dependencies: + object.getownpropertydescriptors: 2.1.7 + semver: 5.7.2 + dev: false + /node-fetch@2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} engines: {node: 4.x || >=6.0.0} @@ -7406,6 +7592,16 @@ packages: engines: {node: '>= 0.4'} dev: false + /object.assign@4.1.0: + resolution: {integrity: sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.0 + function-bind: 1.1.1 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: false + /object.assign@4.1.4: resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} engines: {node: '>= 0.4'} @@ -7425,6 +7621,17 @@ packages: es-abstract: 1.22.1 dev: false + /object.getownpropertydescriptors@2.1.7: + resolution: {integrity: sha512-PrJz0C2xJ58FNn11XV2lr4Jt5Gzl94qpy9Lu0JlfEj14z88sqbSBJCBEzdlNUCzY2gburhbrwOZ5BHCmuNUy0g==} + engines: {node: '>= 0.8'} + dependencies: + array.prototype.reduce: 1.0.6 + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + safe-array-concat: 1.0.0 + dev: false + /object.groupby@1.0.0: resolution: {integrity: sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==} dependencies: @@ -7544,6 +7751,13 @@ packages: yocto-queue: 0.1.0 dev: false + /p-locate@3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + dependencies: + p-limit: 2.3.0 + dev: false + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -7629,6 +7843,11 @@ packages: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} dev: false + /path-exists@3.0.0: + resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} + engines: {node: '>=4'} + dev: false + /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -8095,6 +8314,13 @@ packages: util-deprecate: 1.0.2 dev: false + /readdirp@3.2.0: + resolution: {integrity: sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==} + engines: {node: '>= 8'} + dependencies: + picomatch: 2.3.1 + dev: false + /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -8676,6 +8902,23 @@ packages: engines: {node: '>=0.6.19'} dev: false + /string-width@2.1.1: + resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} + engines: {node: '>=4'} + dependencies: + is-fullwidth-code-point: 2.0.0 + strip-ansi: 4.0.0 + dev: false + + /string-width@3.1.0: + resolution: {integrity: sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==} + engines: {node: '>=6'} + dependencies: + emoji-regex: 7.0.3 + is-fullwidth-code-point: 2.0.0 + strip-ansi: 5.2.0 + dev: false + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -8751,6 +8994,13 @@ packages: ansi-regex: 3.0.1 dev: false + /strip-ansi@5.2.0: + resolution: {integrity: sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==} + engines: {node: '>=6'} + dependencies: + ansi-regex: 4.1.1 + dev: false + /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -8817,6 +9067,13 @@ packages: has-flag: 3.0.0 dev: false + /supports-color@6.0.0: + resolution: {integrity: sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==} + engines: {node: '>=6'} + dependencies: + has-flag: 3.0.0 + dev: false + /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -9406,6 +9663,12 @@ packages: isexe: 2.0.0 dev: false + /wide-align@1.1.3: + resolution: {integrity: sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==} + dependencies: + string-width: 2.1.1 + dev: false + /word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -9415,6 +9678,15 @@ packages: resolution: {integrity: sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==} dev: false + /wrap-ansi@5.1.0: + resolution: {integrity: sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==} + engines: {node: '>=6'} + dependencies: + ansi-styles: 3.2.1 + string-width: 3.1.0 + strip-ansi: 5.2.0 + dev: false + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -9554,6 +9826,13 @@ packages: engines: {node: '>= 14'} dev: false + /yargs-parser@13.1.2: + resolution: {integrity: sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: false + /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} @@ -9577,6 +9856,15 @@ packages: engines: {node: '>=12'} dev: false + /yargs-unparser@1.6.0: + resolution: {integrity: sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==} + engines: {node: '>=6'} + dependencies: + flat: 4.1.1 + lodash: 4.17.21 + yargs: 13.3.2 + dev: false + /yargs-unparser@2.0.0: resolution: {integrity: sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==} engines: {node: '>=10'} @@ -9587,6 +9875,21 @@ packages: is-plain-obj: 2.1.0 dev: false + /yargs@13.3.2: + resolution: {integrity: sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==} + dependencies: + cliui: 5.0.0 + find-up: 3.0.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 3.1.0 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 13.1.2 + dev: false + /yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} @@ -10475,7 +10778,7 @@ packages: dev: false file:projects/arm-apicenter.tgz: - resolution: {integrity: sha512-otU/1G81OpAvfbgT/5fLDBi4TZ92TLQjjL08Hy1NKwxN8DaoVobBOvR6ujF8nKns6UnRRJCVtjnDpCQtyLb84A==, tarball: file:projects/arm-apicenter.tgz} + resolution: {integrity: sha512-j5XsMfT6eK7toZyTrweB0DKyENYsxbr8F8MJqEZYDtEMVRY98Kr/B2DHAihjO0Q39uUIMh2Y2yj/mNUv/XPzmA==, tarball: file:projects/arm-apicenter.tgz} name: '@rush-temp/arm-apicenter' version: 0.0.0 dependencies: @@ -10491,13 +10794,18 @@ packages: cross-env: 7.0.3 dotenv: 16.3.1 mkdirp: 2.1.6 - mocha: 10.2.0 - rimraf: 3.0.2 + mocha: 7.2.0 + rimraf: 5.0.1 rollup: 2.79.1 rollup-plugin-sourcemaps: 0.6.3(@types/node@14.18.56)(rollup@2.79.1) + ts-node: 10.9.1(@types/node@14.18.56)(typescript@5.0.4) tslib: 2.6.2 typescript: 5.0.4 uglify-js: 3.17.4 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + - supports-color dev: false file:projects/arm-apimanagement.tgz: diff --git a/sdk/apicenter/arm-apicenter/CHANGELOG.md b/sdk/apicenter/arm-apicenter/CHANGELOG.md index 921db47e135a..9cec1b33a834 100644 --- a/sdk/apicenter/arm-apicenter/CHANGELOG.md +++ b/sdk/apicenter/arm-apicenter/CHANGELOG.md @@ -1,5 +1,5 @@ # Release History -## 1.0.0-beta.1 (2023-08-16) +## 1.0.0 (2023-09-26) The package of @azure/arm-apicenter is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/apicenter/arm-apicenter/README.md b/sdk/apicenter/arm-apicenter/README.md index 0d166c094d99..d25b302da1bc 100644 --- a/sdk/apicenter/arm-apicenter/README.md +++ b/sdk/apicenter/arm-apicenter/README.md @@ -6,7 +6,7 @@ Azure API Center Resource Provider. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/arm-apicenter) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-apicenter) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-apicenter?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-apicenter) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/apicenter/arm-apicenter/_meta.json b/sdk/apicenter/arm-apicenter/_meta.json index d77db1002320..02b52ba47508 100644 --- a/sdk/apicenter/arm-apicenter/_meta.json +++ b/sdk/apicenter/arm-apicenter/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d99f18b18405cd446f7abc2c9e6b3884f5c549f8", + "commit": "2535e423effbb82dab84a2e06bfb986eb992ce7d", "readme": "specification/apicenter/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\apicenter\\resource-manager\\readme.md --use=@autorest/typescript@6.0.5 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/apicenter/resource-manager/readme.md --use=@autorest/typescript@^6.0.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", - "use": "@autorest/typescript@6.0.5" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/apicenter/arm-apicenter/assets.json b/sdk/apicenter/arm-apicenter/assets.json deleted file mode 100644 index 41fad2851cfd..000000000000 --- a/sdk/apicenter/arm-apicenter/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/apicenter/arm-apicenter", - "Tag": "js/apicenter/arm-apicenter_a7b4c73e8e" -} diff --git a/sdk/apicenter/arm-apicenter/package.json b/sdk/apicenter/arm-apicenter/package.json index 42f4a78d077d..dc34cbd5b425 100644 --- a/sdk/apicenter/arm-apicenter/package.json +++ b/sdk/apicenter/arm-apicenter/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureAPICenter.", - "version": "1.0.0-beta.1", + "version": "1.0.0", "engines": { "node": ">=14.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -36,16 +36,17 @@ "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", - "@azure/identity": "^3.3.0", + "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", - "mocha": "^10.0.0", + "mocha": "^7.1.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", + "ts-node": "^10.0.0", "@azure/dev-tool": "^1.0.0" }, "repository": { @@ -81,7 +82,7 @@ "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -109,13 +110,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/arm-apicenter", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-apicenter?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/arm-apicenter" +} \ No newline at end of file diff --git a/sdk/apicenter/arm-apicenter/review/arm-apicenter.api.md b/sdk/apicenter/arm-apicenter/review/arm-apicenter.api.md index fedb06b03bdf..e0234a632e33 100644 --- a/sdk/apicenter/arm-apicenter/review/arm-apicenter.api.md +++ b/sdk/apicenter/arm-apicenter/review/arm-apicenter.api.md @@ -11,19 +11,332 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; // @public export type ActionType = string; +// @public +export interface Api extends Resource { + // (undocumented) + contacts?: Contact[]; + customProperties?: Record; + description?: string; + // (undocumented) + externalDocumentation?: ExternalDocumentation[]; + license?: License; + readonly lifecycleStage?: LifecycleStage; + summary?: string; + termsOfService?: TermsOfService; + title?: string; + typePropertiesType?: ApiType; +} + +// @public +export interface ApiCollection { + count?: number; + readonly nextLink?: string; + readonly value?: Api[]; +} + +// @public +export interface ApiDefinition extends Resource { + description?: string; + readonly specification?: ApiDefinitionPropertiesSpecification; + title?: string; +} + +// @public +export interface ApiDefinitionCollection { + count?: number; + readonly nextLink?: string; + readonly value?: ApiDefinition[]; +} + +// @public (undocumented) +export interface ApiDefinitionPropertiesSpecification { + // (undocumented) + name?: string; + // (undocumented) + version?: string; +} + +// @public +export interface ApiDefinitions { + createOrUpdate(resourceGroupName: string, serviceName: string, payload: ApiDefinition, options?: ApiDefinitionsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, options?: ApiDefinitionsDeleteOptionalParams): Promise; + exportSpecification(resourceGroupName: string, serviceName: string, options?: ApiDefinitionsExportSpecificationOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, options?: ApiDefinitionsGetOptionalParams): Promise; + head(resourceGroupName: string, serviceName: string, options?: ApiDefinitionsHeadOptionalParams): Promise; + importSpecification(resourceGroupName: string, serviceName: string, payload: ApiSpecImportSource, options?: ApiDefinitionsImportSpecificationOptionalParams): Promise; + list(resourceGroupName: string, serviceName: string, options?: ApiDefinitionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ApiDefinitionsCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface ApiDefinitionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiDefinitionsCreateOrUpdateResponse = ApiDefinitionsCreateOrUpdateHeaders & ApiDefinition; + +// @public +export interface ApiDefinitionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ApiDefinitionsExportSpecificationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiDefinitionsExportSpecificationResponse = ApiSpecExportResult; + +// @public +export interface ApiDefinitionsGetHeaders { + eTag?: string; +} + +// @public +export interface ApiDefinitionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiDefinitionsGetResponse = ApiDefinitionsGetHeaders & ApiDefinition; + +// @public +export interface ApiDefinitionsHeadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiDefinitionsHeadResponse = { + body: boolean; +}; + +// @public +export interface ApiDefinitionsImportSpecificationOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ApiDefinitionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiDefinitionsListNextResponse = ApiDefinitionCollection; + +// @public +export interface ApiDefinitionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiDefinitionsListResponse = ApiDefinitionCollection; + +// @public +export interface Apis { + createOrUpdate(resourceGroupName: string, serviceName: string, payload: Api, options?: ApisCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, options?: ApisDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, options?: ApisGetOptionalParams): Promise; + head(resourceGroupName: string, serviceName: string, options?: ApisHeadOptionalParams): Promise; + list(resourceGroupName: string, serviceName: string, options?: ApisListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ApisCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface ApisCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApisCreateOrUpdateResponse = ApisCreateOrUpdateHeaders & Api; + +// @public +export interface ApisDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ApisGetHeaders { + eTag?: string; +} + +// @public +export interface ApisGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApisGetResponse = ApisGetHeaders & Api; + +// @public +export interface ApisHeadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApisHeadResponse = { + body: boolean; +}; + +// @public +export interface ApisListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApisListNextResponse = ApiCollection; + +// @public +export interface ApisListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApisListResponse = ApiCollection; + +// @public +export interface ApiSpecExportResult { + // (undocumented) + format?: ApiSpecExportResultFormat; + value?: string; +} + +// @public +export type ApiSpecExportResultFormat = string; + +// @public +export interface ApiSpecImportSource { + format?: ApiSpecImportSourceFormat; + // (undocumented) + specification?: ApiSpecImportSourceSpecification; + value?: string; +} + +// @public +export type ApiSpecImportSourceFormat = string; + +// @public (undocumented) +export interface ApiSpecImportSourceSpecification { + // (undocumented) + name?: string; + // (undocumented) + value?: string; +} + +// @public +export type ApiType = string; + +// @public +export interface ApiVersion extends Resource { + lifecycleStage?: LifecycleStage; + title?: string; +} + +// @public +export interface ApiVersionCollection { + count?: number; + readonly nextLink?: string; + readonly value?: ApiVersion[]; +} + +// @public +export interface ApiVersions { + createOrUpdate(resourceGroupName: string, serviceName: string, payload: ApiVersion, options?: ApiVersionsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, options?: ApiVersionsDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, options?: ApiVersionsGetOptionalParams): Promise; + head(resourceGroupName: string, serviceName: string, options?: ApiVersionsHeadOptionalParams): Promise; + list(resourceGroupName: string, serviceName: string, options?: ApiVersionsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface ApiVersionsCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface ApiVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiVersionsCreateOrUpdateResponse = ApiVersionsCreateOrUpdateHeaders & ApiVersion; + +// @public +export interface ApiVersionsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ApiVersionsGetHeaders { + eTag?: string; +} + +// @public +export interface ApiVersionsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiVersionsGetResponse = ApiVersionsGetHeaders & ApiVersion; + +// @public +export interface ApiVersionsHeadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiVersionsHeadResponse = { + body: boolean; +}; + +// @public +export interface ApiVersionsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiVersionsListNextResponse = ApiVersionCollection; + +// @public +export interface ApiVersionsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ApiVersionsListResponse = ApiVersionCollection; + // @public (undocumented) export class AzureAPICenter extends coreClient.ServiceClient { // (undocumented) $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: AzureAPICenterOptionalParams); + constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, metadataSchemaName: string, workspaceName: string, apiName: string, versionName: string, definitionName: string, deploymentName: string, environmentName: string, options?: AzureAPICenterOptionalParams); + // (undocumented) + apiDefinitions: ApiDefinitions; + // (undocumented) + apiName: string; + // (undocumented) + apis: Apis; // (undocumented) apiVersion: string; // (undocumented) + apiVersions: ApiVersions; + // (undocumented) + definitionName: string; + // (undocumented) + deploymentName: string; + // (undocumented) + deployments: Deployments; + // (undocumented) + environmentName: string; + // (undocumented) + environments: Environments; + // (undocumented) + filter?: string; + // (undocumented) + metadataSchemaName: string; + // (undocumented) + metadataSchemas: MetadataSchemas; + // (undocumented) operations: Operations; // (undocumented) services: Services; // (undocumented) subscriptionId: string; + // (undocumented) + versionName: string; + // (undocumented) + workspaceName: string; + // (undocumented) + workspaces: Workspaces; } // @public @@ -31,11 +344,196 @@ export interface AzureAPICenterOptionalParams extends coreClient.ServiceClientOp $host?: string; apiVersion?: string; endpoint?: string; + filter?: string; +} + +// @public (undocumented) +export interface Contact { + email?: string; + name?: string; + url?: string; } // @public export type CreatedByType = string; +// @public +export interface Deployment extends Resource { + customProperties?: Record; + definitionId?: string; + description?: string; + environmentId?: string; + server?: DeploymentServer; + state?: DeploymentState; + title?: string; +} + +// @public +export interface DeploymentCollection { + count?: number; + readonly nextLink?: string; + readonly value?: Deployment[]; +} + +// @public +export interface Deployments { + createOrUpdate(resourceGroupName: string, serviceName: string, payload: Deployment, options?: DeploymentsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, options?: DeploymentsDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, options?: DeploymentsGetOptionalParams): Promise; + head(resourceGroupName: string, serviceName: string, options?: DeploymentsHeadOptionalParams): Promise; + list(resourceGroupName: string, serviceName: string, options?: DeploymentsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface DeploymentsCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface DeploymentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsCreateOrUpdateResponse = DeploymentsCreateOrUpdateHeaders & Deployment; + +// @public +export interface DeploymentsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface DeploymentServer { + runtimeUri?: string[]; +} + +// @public +export interface DeploymentsGetHeaders { + eTag?: string; +} + +// @public +export interface DeploymentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsGetResponse = DeploymentsGetHeaders & Deployment; + +// @public +export interface DeploymentsHeadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsHeadResponse = { + body: boolean; +}; + +// @public +export interface DeploymentsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsListNextResponse = DeploymentCollection; + +// @public +export interface DeploymentsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DeploymentsListResponse = DeploymentCollection; + +// @public +export type DeploymentState = string; + +// @public +export interface Environment extends Resource { + customProperties?: Record; + description?: string; + // (undocumented) + onboarding?: Onboarding; + server?: EnvironmentServer; + title?: string; + typePropertiesType?: EnvironmentType; +} + +// @public +export interface EnvironmentCollection { + count?: number; + readonly nextLink?: string; + readonly value?: Environment[]; +} + +// @public +export interface Environments { + createOrUpdate(resourceGroupName: string, serviceName: string, payload: Environment, options?: EnvironmentsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, options?: EnvironmentsDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, options?: EnvironmentsGetOptionalParams): Promise; + head(resourceGroupName: string, serviceName: string, options?: EnvironmentsHeadOptionalParams): Promise; + list(resourceGroupName: string, serviceName: string, options?: EnvironmentsListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface EnvironmentsCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface EnvironmentsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentsCreateOrUpdateResponse = EnvironmentsCreateOrUpdateHeaders & Environment; + +// @public +export interface EnvironmentsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface EnvironmentServer { + // (undocumented) + managementPortalUri?: string[]; + type?: EnvironmentServerType; +} + +// @public +export type EnvironmentServerType = string; + +// @public +export interface EnvironmentsGetHeaders { + eTag?: string; +} + +// @public +export interface EnvironmentsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentsGetResponse = EnvironmentsGetHeaders & Environment; + +// @public +export interface EnvironmentsHeadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentsHeadResponse = { + body: boolean; +}; + +// @public +export interface EnvironmentsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentsListNextResponse = EnvironmentCollection; + +// @public +export interface EnvironmentsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type EnvironmentsListResponse = EnvironmentCollection; + +// @public +export type EnvironmentType = string; + // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -56,6 +554,13 @@ export interface ErrorResponse { error?: ErrorDetail; } +// @public +export interface ExternalDocumentation { + description?: string; + title?: string; + url: string; +} + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -64,6 +569,28 @@ export enum KnownActionType { Internal = "Internal" } +// @public +export enum KnownApiSpecExportResultFormat { + Inline = "inline", + Link = "link" +} + +// @public +export enum KnownApiSpecImportSourceFormat { + Inline = "inline", + Link = "link" +} + +// @public +export enum KnownApiType { + Graphql = "graphql", + Grpc = "grpc", + Rest = "rest", + Soap = "soap", + Webhook = "webhook", + Websocket = "websocket" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -72,6 +599,42 @@ export enum KnownCreatedByType { User = "User" } +// @public +export enum KnownDeploymentState { + Active = "active", + Inactive = "inactive" +} + +// @public +export enum KnownEnvironmentServerType { + ApigeeAPIManagement = "Apigee API Management", + AWSAPIGateway = "AWS API Gateway", + AzureAPIManagement = "Azure API Management", + AzureComputeService = "Azure compute service", + KongAPIGateway = "Kong API Gateway", + Kubernetes = "Kubernetes", + MuleSoftAPIManagement = "MuleSoft API Management" +} + +// @public +export enum KnownEnvironmentType { + Development = "development", + Production = "production", + Staging = "staging", + Testing = "testing" +} + +// @public +export enum KnownLifecycleStage { + Deprecated = "deprecated", + Design = "design", + Development = "development", + Preview = "preview", + Production = "production", + Retired = "retired", + Testing = "testing" +} + // @public export enum KnownManagedServiceIdentityType { None = "None", @@ -80,6 +643,19 @@ export enum KnownManagedServiceIdentityType { UserAssigned = "UserAssigned" } +// @public +export enum KnownMetadataAssignmentEntity { + Api = "api", + Deployment = "deployment", + Environment = "environment" +} + +// @public +export enum KnownMetadataSchemaExportFormat { + Inline = "inline", + Link = "link" +} + // @public export enum KnownOrigin { System = "system", @@ -94,6 +670,16 @@ export enum KnownProvisioningState { Succeeded = "Succeeded" } +// @public +export interface License { + identifier?: string; + name?: string; + url?: string; +} + +// @public +export type LifecycleStage = string; + // @public export interface ManagedServiceIdentity { readonly principalId?: string; @@ -107,6 +693,109 @@ export interface ManagedServiceIdentity { // @public export type ManagedServiceIdentityType = string; +// @public (undocumented) +export interface MetadataAssignment { + // (undocumented) + deprecated?: boolean; + entity?: MetadataAssignmentEntity; + // (undocumented) + required?: boolean; +} + +// @public +export type MetadataAssignmentEntity = string; + +// @public +export interface MetadataSchema extends Resource { + // (undocumented) + assignedTo?: MetadataAssignment[]; + schema?: string; +} + +// @public +export interface MetadataSchemaCollection { + count?: number; + readonly nextLink?: string; + readonly value?: MetadataSchema[]; +} + +// @public +export type MetadataSchemaExportFormat = string; + +// @public +export interface MetadataSchemaExportResult { + // (undocumented) + format?: MetadataSchemaExportFormat; + value?: string; +} + +// @public +export interface MetadataSchemas { + createOrUpdate(resourceGroupName: string, serviceName: string, payload: MetadataSchema, options?: MetadataSchemasCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, options?: MetadataSchemasDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, options?: MetadataSchemasGetOptionalParams): Promise; + head(resourceGroupName: string, serviceName: string, options?: MetadataSchemasHeadOptionalParams): Promise; + list(resourceGroupName: string, serviceName: string, options?: MetadataSchemasListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface MetadataSchemasCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface MetadataSchemasCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataSchemasCreateOrUpdateResponse = MetadataSchemasCreateOrUpdateHeaders & MetadataSchema; + +// @public +export interface MetadataSchemasDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface MetadataSchemasGetHeaders { + eTag?: string; +} + +// @public +export interface MetadataSchemasGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataSchemasGetResponse = MetadataSchemasGetHeaders & MetadataSchema; + +// @public +export interface MetadataSchemasHeadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataSchemasHeadResponse = { + body: boolean; +}; + +// @public +export interface MetadataSchemasListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataSchemasListNextResponse = MetadataSchemaCollection; + +// @public +export interface MetadataSchemasListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MetadataSchemasListResponse = MetadataSchemaCollection; + +// @public (undocumented) +export interface Onboarding { + // (undocumented) + developerPortalUri?: string[]; + instructions?: string; +} + // @public export interface Operation { readonly actionType?: ActionType; @@ -179,6 +868,7 @@ export interface ServiceCollection { export interface Services { createOrUpdate(resourceGroupName: string, serviceName: string, options?: ServicesCreateOrUpdateOptionalParams): Promise; delete(resourceGroupName: string, serviceName: string, options?: ServicesDeleteOptionalParams): Promise; + exportMetadataSchema(resourceGroupName: string, serviceName: string, assignedTo: MetadataAssignmentEntity, options?: ServicesExportMetadataSchemaOptionalParams): Promise; get(resourceGroupName: string, serviceName: string, options?: ServicesGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: ServicesListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: ServicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; @@ -187,7 +877,7 @@ export interface Services { // @public export interface ServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resource?: Service; + payload?: Service; } // @public @@ -197,6 +887,13 @@ export type ServicesCreateOrUpdateResponse = Service; export interface ServicesDeleteOptionalParams extends coreClient.OperationOptions { } +// @public +export interface ServicesExportMetadataSchemaOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ServicesExportMetadataSchemaResponse = MetadataSchemaExportResult; + // @public export interface ServicesGetOptionalParams extends coreClient.OperationOptions { } @@ -234,7 +931,7 @@ export type ServicesListBySubscriptionResponse = ServiceCollection; // @public export interface ServicesUpdateOptionalParams extends coreClient.OperationOptions { - parameters?: ServiceUpdate; + payload?: ServiceUpdate; } // @public @@ -255,6 +952,11 @@ export interface SystemData { lastModifiedByType?: CreatedByType; } +// @public +export interface TermsOfService { + url: string; +} + // @public export interface TrackedResource extends Resource { location: string; @@ -269,6 +971,79 @@ export interface UserAssignedIdentity { readonly principalId?: string; } +// @public +export interface Workspace extends Resource { + description?: string; + title?: string; +} + +// @public +export interface WorkspaceCollection { + count?: number; + readonly nextLink?: string; + readonly value?: Workspace[]; +} + +// @public +export interface Workspaces { + createOrUpdate(resourceGroupName: string, serviceName: string, payload: Workspace, options?: WorkspacesCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, serviceName: string, options?: WorkspacesDeleteOptionalParams): Promise; + get(resourceGroupName: string, serviceName: string, options?: WorkspacesGetOptionalParams): Promise; + head(resourceGroupName: string, serviceName: string, options?: WorkspacesHeadOptionalParams): Promise; + list(resourceGroupName: string, serviceName: string, options?: WorkspacesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface WorkspacesCreateOrUpdateHeaders { + eTag?: string; +} + +// @public +export interface WorkspacesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesCreateOrUpdateResponse = WorkspacesCreateOrUpdateHeaders & Workspace; + +// @public +export interface WorkspacesDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface WorkspacesGetHeaders { + eTag?: string; +} + +// @public +export interface WorkspacesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesGetResponse = WorkspacesGetHeaders & Workspace; + +// @public +export interface WorkspacesHeadOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesHeadResponse = { + body: boolean; +}; + +// @public +export interface WorkspacesListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesListNextResponse = WorkspaceCollection; + +// @public +export interface WorkspacesListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type WorkspacesListResponse = WorkspaceCollection; + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/apicenter/arm-apicenter/samples-dev/operationsListSample.ts b/sdk/apicenter/arm-apicenter/samples-dev/operationsListSample.ts deleted file mode 100644 index 80d069634b79..000000000000 --- a/sdk/apicenter/arm-apicenter/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples-dev/servicesCreateOrUpdateSample.ts b/sdk/apicenter/arm-apicenter/samples-dev/servicesCreateOrUpdateSample.ts deleted file mode 100644 index fc5521a6b2be..000000000000 --- a/sdk/apicenter/arm-apicenter/samples-dev/servicesCreateOrUpdateSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update service - * - * @summary Create or update service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_CreateOrUpdate.json - */ -async function servicesCreate() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.createOrUpdate( - resourceGroupName, - serviceName - ); - console.log(result); -} - -async function main() { - servicesCreate(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples-dev/servicesDeleteSample.ts b/sdk/apicenter/arm-apicenter/samples-dev/servicesDeleteSample.ts deleted file mode 100644 index 7be37362b69f..000000000000 --- a/sdk/apicenter/arm-apicenter/samples-dev/servicesDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete service - * - * @summary Delete service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Delete.json - */ -async function servicesDelete() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.delete(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesDelete(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples-dev/servicesGetSample.ts b/sdk/apicenter/arm-apicenter/samples-dev/servicesGetSample.ts deleted file mode 100644 index 7374fd731344..000000000000 --- a/sdk/apicenter/arm-apicenter/samples-dev/servicesGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get service - * - * @summary Get service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Get.json - */ -async function servicesGet() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.get(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesGet(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples-dev/servicesListByResourceGroupSample.ts b/sdk/apicenter/arm-apicenter/samples-dev/servicesListByResourceGroupSample.ts deleted file mode 100644 index d2ad34d0bd80..000000000000 --- a/sdk/apicenter/arm-apicenter/samples-dev/servicesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists services within a resource group - * - * @summary Lists services within a resource group - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListByResourceGroup.json - */ -async function servicesListByResourceGroup() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.services.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - servicesListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples-dev/servicesListBySubscriptionSample.ts b/sdk/apicenter/arm-apicenter/samples-dev/servicesListBySubscriptionSample.ts deleted file mode 100644 index 57ea59d66c5e..000000000000 --- a/sdk/apicenter/arm-apicenter/samples-dev/servicesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists services within an Azure subscription. - * - * @summary Lists services within an Azure subscription. - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListBySubscription.json - */ -async function servicesListBySubscription() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.services.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - servicesListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples-dev/servicesUpdateSample.ts b/sdk/apicenter/arm-apicenter/samples-dev/servicesUpdateSample.ts deleted file mode 100644 index ab07861480bc..000000000000 --- a/sdk/apicenter/arm-apicenter/samples-dev/servicesUpdateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update service - * - * @summary Update service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Update.json - */ -async function servicesUpdate() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.update(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/README.md b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/README.md deleted file mode 100644 index 460d6106daae..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,62 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Operations_List.json | -| [servicesCreateOrUpdateSample.js][servicescreateorupdatesample] | Create or update service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_CreateOrUpdate.json | -| [servicesDeleteSample.js][servicesdeletesample] | Delete service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Delete.json | -| [servicesGetSample.js][servicesgetsample] | Get service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Get.json | -| [servicesListByResourceGroupSample.js][serviceslistbyresourcegroupsample] | Lists services within a resource group x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListByResourceGroup.json | -| [servicesListBySubscriptionSample.js][serviceslistbysubscriptionsample] | Lists services within an Azure subscription. x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListBySubscription.json | -| [servicesUpdateSample.js][servicesupdatesample] | Update service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node operationsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env APICENTER_SUBSCRIPTION_ID="" node operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/operationsListSample.js -[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js -[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesDeleteSample.js -[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesGetSample.js -[serviceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListByResourceGroupSample.js -[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListBySubscriptionSample.js -[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-apicenter?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/arm-apicenter/README.md diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/operationsListSample.js b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/operationsListSample.js deleted file mode 100644 index 3d24f801450e..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureAPICenter } = require("@azure/arm-apicenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/package.json b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/package.json deleted file mode 100644 index baad78083230..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-apicenter-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/apicenter/arm-apicenter" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/arm-apicenter", - "dependencies": { - "@azure/arm-apicenter": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/sample.env b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js deleted file mode 100644 index 5e03075a53d4..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesCreateOrUpdateSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureAPICenter } = require("@azure/arm-apicenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create or update service - * - * @summary Create or update service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_CreateOrUpdate.json - */ -async function servicesCreate() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.createOrUpdate(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesCreate(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesDeleteSample.js b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesDeleteSample.js deleted file mode 100644 index 44decf6e44da..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureAPICenter } = require("@azure/arm-apicenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete service - * - * @summary Delete service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Delete.json - */ -async function servicesDelete() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.delete(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesDelete(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesGetSample.js b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesGetSample.js deleted file mode 100644 index 123e8fda4120..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureAPICenter } = require("@azure/arm-apicenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get service - * - * @summary Get service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Get.json - */ -async function servicesGet() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.get(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesGet(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListByResourceGroupSample.js b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListByResourceGroupSample.js deleted file mode 100644 index eb773c864d00..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureAPICenter } = require("@azure/arm-apicenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists services within a resource group - * - * @summary Lists services within a resource group - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListByResourceGroup.json - */ -async function servicesListByResourceGroup() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.services.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - servicesListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListBySubscriptionSample.js b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListBySubscriptionSample.js deleted file mode 100644 index e1d743185cf0..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureAPICenter } = require("@azure/arm-apicenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists services within an Azure subscription. - * - * @summary Lists services within an Azure subscription. - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListBySubscription.json - */ -async function servicesListBySubscription() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.services.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - servicesListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesUpdateSample.js b/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesUpdateSample.js deleted file mode 100644 index af94d80e530b..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/javascript/servicesUpdateSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureAPICenter } = require("@azure/arm-apicenter"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update service - * - * @summary Update service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Update.json - */ -async function servicesUpdate() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.update(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/README.md b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/README.md deleted file mode 100644 index 7b484506e8d8..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Operations_List.json | -| [servicesCreateOrUpdateSample.ts][servicescreateorupdatesample] | Create or update service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_CreateOrUpdate.json | -| [servicesDeleteSample.ts][servicesdeletesample] | Delete service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Delete.json | -| [servicesGetSample.ts][servicesgetsample] | Get service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Get.json | -| [servicesListByResourceGroupSample.ts][serviceslistbyresourcegroupsample] | Lists services within a resource group x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListByResourceGroup.json | -| [servicesListBySubscriptionSample.ts][serviceslistbysubscriptionsample] | Lists services within an Azure subscription. x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListBySubscription.json | -| [servicesUpdateSample.ts][servicesupdatesample] | Update service x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Update.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/operationsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env APICENTER_SUBSCRIPTION_ID="" node dist/operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/operationsListSample.ts -[servicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts -[servicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesDeleteSample.ts -[servicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesGetSample.ts -[serviceslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListByResourceGroupSample.ts -[serviceslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts -[servicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-apicenter?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/arm-apicenter/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/package.json b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/package.json deleted file mode 100644 index 088f06b817f4..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-apicenter-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/apicenter/arm-apicenter" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/apicenter/arm-apicenter", - "dependencies": { - "@azure/arm-apicenter": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~5.0.0", - "rimraf": "latest" - } -} diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/sample.env b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index 80d069634b79..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts deleted file mode 100644 index fc5521a6b2be..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesCreateOrUpdateSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create or update service - * - * @summary Create or update service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_CreateOrUpdate.json - */ -async function servicesCreate() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.createOrUpdate( - resourceGroupName, - serviceName - ); - console.log(result); -} - -async function main() { - servicesCreate(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesDeleteSample.ts b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesDeleteSample.ts deleted file mode 100644 index 7be37362b69f..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesDeleteSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete service - * - * @summary Delete service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Delete.json - */ -async function servicesDelete() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.delete(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesDelete(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesGetSample.ts b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesGetSample.ts deleted file mode 100644 index 7374fd731344..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get service - * - * @summary Get service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Get.json - */ -async function servicesGet() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.get(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesGet(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListByResourceGroupSample.ts b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListByResourceGroupSample.ts deleted file mode 100644 index d2ad34d0bd80..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists services within a resource group - * - * @summary Lists services within a resource group - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListByResourceGroup.json - */ -async function servicesListByResourceGroup() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.services.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - servicesListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts deleted file mode 100644 index 57ea59d66c5e..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists services within an Azure subscription. - * - * @summary Lists services within an Azure subscription. - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_ListBySubscription.json - */ -async function servicesListBySubscription() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.services.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - servicesListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesUpdateSample.ts b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesUpdateSample.ts deleted file mode 100644 index ab07861480bc..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/src/servicesUpdateSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureAPICenter } from "@azure/arm-apicenter"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update service - * - * @summary Update service - * x-ms-original-file: specification/apicenter/resource-manager/Microsoft.ApiCenter/preview/2023-07-01-preview/examples/Services_Update.json - */ -async function servicesUpdate() { - const subscriptionId = - process.env["APICENTER_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["APICENTER_RESOURCE_GROUP"] || "contoso-resources"; - const serviceName = "contoso"; - const credential = new DefaultAzureCredential(); - const client = new AzureAPICenter(credential, subscriptionId); - const result = await client.services.update(resourceGroupName, serviceName); - console.log(result); -} - -async function main() { - servicesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/tsconfig.json b/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/apicenter/arm-apicenter/samples/v1-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/apicenter/arm-apicenter/src/azureAPICenter.ts b/sdk/apicenter/arm-apicenter/src/azureAPICenter.ts index 40682b022a8e..183802d009b6 100644 --- a/sdk/apicenter/arm-apicenter/src/azureAPICenter.ts +++ b/sdk/apicenter/arm-apicenter/src/azureAPICenter.ts @@ -14,24 +14,66 @@ import { SendRequest } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { OperationsImpl, ServicesImpl } from "./operations"; -import { Operations, Services } from "./operationsInterfaces"; +import { + OperationsImpl, + ServicesImpl, + MetadataSchemasImpl, + WorkspacesImpl, + ApisImpl, + ApiVersionsImpl, + ApiDefinitionsImpl, + DeploymentsImpl, + EnvironmentsImpl +} from "./operations"; +import { + Operations, + Services, + MetadataSchemas, + Workspaces, + Apis, + ApiVersions, + ApiDefinitions, + Deployments, + Environments +} from "./operationsInterfaces"; import { AzureAPICenterOptionalParams } from "./models"; export class AzureAPICenter extends coreClient.ServiceClient { $host: string; apiVersion: string; subscriptionId: string; + filter?: string; + metadataSchemaName: string; + workspaceName: string; + apiName: string; + versionName: string; + definitionName: string; + deploymentName: string; + environmentName: string; /** * Initializes a new instance of the AzureAPICenter class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + * @param metadataSchemaName The name of the metadata schema. + * @param workspaceName The name of the workspace. + * @param apiName The name of the API. + * @param versionName The name of the API version. + * @param definitionName The name of the API definition. + * @param deploymentName The name of the API deployment. + * @param environmentName The name of the environment. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, + metadataSchemaName: string, + workspaceName: string, + apiName: string, + versionName: string, + definitionName: string, + deploymentName: string, + environmentName: string, options?: AzureAPICenterOptionalParams ) { if (credentials === undefined) { @@ -40,6 +82,27 @@ export class AzureAPICenter extends coreClient.ServiceClient { if (subscriptionId === undefined) { throw new Error("'subscriptionId' cannot be null"); } + if (metadataSchemaName === undefined) { + throw new Error("'metadataSchemaName' cannot be null"); + } + if (workspaceName === undefined) { + throw new Error("'workspaceName' cannot be null"); + } + if (apiName === undefined) { + throw new Error("'apiName' cannot be null"); + } + if (versionName === undefined) { + throw new Error("'versionName' cannot be null"); + } + if (definitionName === undefined) { + throw new Error("'definitionName' cannot be null"); + } + if (deploymentName === undefined) { + throw new Error("'deploymentName' cannot be null"); + } + if (environmentName === undefined) { + throw new Error("'environmentName' cannot be null"); + } // Initializing default values for options if (!options) { @@ -50,7 +113,7 @@ export class AzureAPICenter extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-apicenter/1.0.0-beta.1`; + const packageDetails = `azsdk-js-arm-apicenter/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -100,12 +163,26 @@ export class AzureAPICenter extends coreClient.ServiceClient { } // Parameter assignments this.subscriptionId = subscriptionId; + this.metadataSchemaName = metadataSchemaName; + this.workspaceName = workspaceName; + this.apiName = apiName; + this.versionName = versionName; + this.definitionName = definitionName; + this.deploymentName = deploymentName; + this.environmentName = environmentName; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-07-01-preview"; + this.apiVersion = options.apiVersion || "2024-03-01"; this.operations = new OperationsImpl(this); this.services = new ServicesImpl(this); + this.metadataSchemas = new MetadataSchemasImpl(this); + this.workspaces = new WorkspacesImpl(this); + this.apis = new ApisImpl(this); + this.apiVersions = new ApiVersionsImpl(this); + this.apiDefinitions = new ApiDefinitionsImpl(this); + this.deployments = new DeploymentsImpl(this); + this.environments = new EnvironmentsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -139,4 +216,11 @@ export class AzureAPICenter extends coreClient.ServiceClient { operations: Operations; services: Services; + metadataSchemas: MetadataSchemas; + workspaces: Workspaces; + apis: Apis; + apiVersions: ApiVersions; + apiDefinitions: ApiDefinitions; + deployments: Deployments; + environments: Environments; } diff --git a/sdk/apicenter/arm-apicenter/src/models/index.ts b/sdk/apicenter/arm-apicenter/src/models/index.ts index ceeef426587a..acf5b37bf694 100644 --- a/sdk/apicenter/arm-apicenter/src/models/index.ts +++ b/sdk/apicenter/arm-apicenter/src/models/index.ts @@ -206,12 +206,218 @@ export interface SystemData { /** The service properties to be updated. */ export interface ServiceUpdate { /** - * The status of the last operation. + * Provisioning state of the service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; } +/** The metadata schema export result. */ +export interface MetadataSchemaExportResult { + format?: MetadataSchemaExportFormat; + /** The result of the export operation. */ + value?: string; +} + +/** Paginated collection of metadata schemas. */ +export interface MetadataSchemaCollection { + /** + * Page items. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: MetadataSchema[]; + /** Total record count number across all pages. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +export interface MetadataAssignment { + /** The entities this metadata schema component gets applied to. */ + entity?: MetadataAssignmentEntity; + required?: boolean; + deprecated?: boolean; +} + +/** Paginated collection of workspaces. */ +export interface WorkspaceCollection { + /** + * Page items. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Workspace[]; + /** Total record count number across all pages. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Paginated collection of APIs. */ +export interface ApiCollection { + /** + * Page items. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Api[]; + /** Total record count number across all pages. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Terms of service for the API. */ +export interface TermsOfService { + /** URL pointing to the terms of service. */ + url: string; +} + +/** Additional, external documentation for the API. */ +export interface ExternalDocumentation { + /** Title of the documentation. */ + title?: string; + /** Description of the documentation. */ + description?: string; + /** URL pointing to the documentation. */ + url: string; +} + +export interface Contact { + /** Name of the contact. */ + name?: string; + /** URL for the contact. */ + url?: string; + /** Email address of the contact. */ + email?: string; +} + +/** The license information for the API. */ +export interface License { + /** Name of the license. */ + name?: string; + /** URL pointing to the license details. The URL field is mutually exclusive of the identifier field. */ + url?: string; + /** SPDX license information for the API. The identifier field is mutually exclusive of the URL field. */ + identifier?: string; +} + +/** Paginated collection of API versions. */ +export interface ApiVersionCollection { + /** + * Page items. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ApiVersion[]; + /** Total record count number across all pages. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Paginated collection of API definitions. */ +export interface ApiDefinitionCollection { + /** + * Page items. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: ApiDefinition[]; + /** Total record count number across all pages. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +export interface ApiDefinitionPropertiesSpecification { + name?: string; + version?: string; +} + +/** The API specification source entity properties. */ +export interface ApiSpecImportSource { + /** Value of the API specification source. */ + value?: string; + /** Format of the API specification source. */ + format?: ApiSpecImportSourceFormat; + specification?: ApiSpecImportSourceSpecification; +} + +export interface ApiSpecImportSourceSpecification { + name?: string; + value?: string; +} + +/** The API specification export result. */ +export interface ApiSpecExportResult { + format?: ApiSpecExportResultFormat; + /** The result of the export operation. */ + value?: string; +} + +/** Paginated collection of API deployments. */ +export interface DeploymentCollection { + /** + * Page items. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Deployment[]; + /** Total record count number across all pages. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Server */ +export interface DeploymentServer { + /** Base runtime URLs for this deployment. */ + runtimeUri?: string[]; +} + +/** Paginated collection of environments. */ +export interface EnvironmentCollection { + /** + * Page items. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly value?: Environment[]; + /** Total record count number across all pages. */ + count?: number; + /** + * Next page link if any. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Server information of the environment. */ +export interface EnvironmentServer { + /** Type of the server that represents the environment. */ + type?: EnvironmentServerType; + managementPortalUri?: string[]; +} + +export interface Onboarding { + /** Onboarding guide. */ + instructions?: string; + developerPortalUri?: string[]; +} + /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export interface TrackedResource extends Resource { /** Resource tags. */ @@ -220,17 +426,192 @@ export interface TrackedResource extends Resource { location: string; } +/** Metadata schema entity. Used to define metadata for the entities in API catalog. */ +export interface MetadataSchema extends Resource { + /** YAML schema defining the type. */ + schema?: string; + assignedTo?: MetadataAssignment[]; +} + +/** Workspace entity. */ +export interface Workspace extends Resource { + /** Workspace display name. */ + title?: string; + /** Workspace description. */ + description?: string; +} + +/** API entity. */ +export interface Api extends Resource { + /** API title. */ + title?: string; + /** Kind of API. For example, REST or GraphQL. */ + typePropertiesType?: ApiType; + /** Description of the API. */ + description?: string; + /** Short description of the API. */ + summary?: string; + /** + * Current lifecycle stage of the API. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly lifecycleStage?: LifecycleStage; + /** Terms of service for the API. */ + termsOfService?: TermsOfService; + externalDocumentation?: ExternalDocumentation[]; + contacts?: Contact[]; + /** The license information for the API. */ + license?: License; + /** The custom metadata defined for API catalog entities. */ + customProperties?: Record; +} + +/** API version entity. */ +export interface ApiVersion extends Resource { + /** API version. */ + title?: string; + /** Current lifecycle stage of the API. */ + lifecycleStage?: LifecycleStage; +} + +/** API definition entity. */ +export interface ApiDefinition extends Resource { + /** API version. */ + title?: string; + /** API definition description. */ + description?: string; + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly specification?: ApiDefinitionPropertiesSpecification; +} + +/** API deployment entity. */ +export interface Deployment extends Resource { + /** Title */ + title?: string; + /** Description of the deployment. */ + description?: string; + /** API center-scoped environment resource ID. */ + environmentId?: string; + /** API center-scoped definition resource ID. */ + definitionId?: string; + /** State of API deployment. */ + state?: DeploymentState; + /** Server */ + server?: DeploymentServer; + /** The custom metadata defined for API catalog entities. */ + customProperties?: Record; +} + +/** Environment entity. */ +export interface Environment extends Resource { + /** Title */ + title?: string; + /** Description. */ + description?: string; + /** Environment type. */ + typePropertiesType?: EnvironmentType; + /** Server information of the environment. */ + server?: EnvironmentServer; + onboarding?: Onboarding; + /** The custom metadata defined for API catalog entities. */ + customProperties?: Record; +} + /** The service entity. */ export interface Service extends TrackedResource { - /** The identity of the service. */ + /** Managed service identity (system assigned and/or user assigned identities) */ identity?: ManagedServiceIdentity; /** - * The status of the last operation. + * Provisioning state of the service. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: ProvisioningState; } +/** Defines headers for MetadataSchemas_get operation. */ +export interface MetadataSchemasGetHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for MetadataSchemas_createOrUpdate operation. */ +export interface MetadataSchemasCreateOrUpdateHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Workspaces_get operation. */ +export interface WorkspacesGetHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Workspaces_createOrUpdate operation. */ +export interface WorkspacesCreateOrUpdateHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Apis_get operation. */ +export interface ApisGetHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Apis_createOrUpdate operation. */ +export interface ApisCreateOrUpdateHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for ApiVersions_get operation. */ +export interface ApiVersionsGetHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for ApiVersions_createOrUpdate operation. */ +export interface ApiVersionsCreateOrUpdateHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for ApiDefinitions_get operation. */ +export interface ApiDefinitionsGetHeaders { + /** Current entity state definition. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for ApiDefinitions_createOrUpdate operation. */ +export interface ApiDefinitionsCreateOrUpdateHeaders { + /** Current entity state definition. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Deployments_get operation. */ +export interface DeploymentsGetHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Deployments_createOrUpdate operation. */ +export interface DeploymentsCreateOrUpdateHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Environments_createOrUpdate operation. */ +export interface EnvironmentsCreateOrUpdateHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + +/** Defines headers for Environments_get operation. */ +export interface EnvironmentsGetHeaders { + /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ + eTag?: string; +} + /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { /** User */ @@ -336,6 +717,219 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link MetadataAssignmentEntity} that the service accepts. */ +export enum KnownMetadataAssignmentEntity { + /** Api */ + Api = "api", + /** Deployment */ + Deployment = "deployment", + /** Environment */ + Environment = "environment" +} + +/** + * Defines values for MetadataAssignmentEntity. \ + * {@link KnownMetadataAssignmentEntity} can be used interchangeably with MetadataAssignmentEntity, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **api** \ + * **deployment** \ + * **environment** + */ +export type MetadataAssignmentEntity = string; + +/** Known values of {@link MetadataSchemaExportFormat} that the service accepts. */ +export enum KnownMetadataSchemaExportFormat { + /** The inlined content of a schema document. */ + Inline = "inline", + /** The link to a schema document. The URL is valid for 5 minutes. */ + Link = "link" +} + +/** + * Defines values for MetadataSchemaExportFormat. \ + * {@link KnownMetadataSchemaExportFormat} can be used interchangeably with MetadataSchemaExportFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **inline**: The inlined content of a schema document. \ + * **link**: The link to a schema document. The URL is valid for 5 minutes. + */ +export type MetadataSchemaExportFormat = string; + +/** Known values of {@link ApiType} that the service accepts. */ +export enum KnownApiType { + /** Rest */ + Rest = "rest", + /** Graphql */ + Graphql = "graphql", + /** Grpc */ + Grpc = "grpc", + /** Soap */ + Soap = "soap", + /** Webhook */ + Webhook = "webhook", + /** Websocket */ + Websocket = "websocket" +} + +/** + * Defines values for ApiType. \ + * {@link KnownApiType} can be used interchangeably with ApiType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **rest** \ + * **graphql** \ + * **grpc** \ + * **soap** \ + * **webhook** \ + * **websocket** + */ +export type ApiType = string; + +/** Known values of {@link LifecycleStage} that the service accepts. */ +export enum KnownLifecycleStage { + /** Design */ + Design = "design", + /** Development */ + Development = "development", + /** Testing */ + Testing = "testing", + /** Preview */ + Preview = "preview", + /** Production */ + Production = "production", + /** Deprecated */ + Deprecated = "deprecated", + /** Retired */ + Retired = "retired" +} + +/** + * Defines values for LifecycleStage. \ + * {@link KnownLifecycleStage} can be used interchangeably with LifecycleStage, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **design** \ + * **development** \ + * **testing** \ + * **preview** \ + * **production** \ + * **deprecated** \ + * **retired** + */ +export type LifecycleStage = string; + +/** Known values of {@link ApiSpecImportSourceFormat} that the service accepts. */ +export enum KnownApiSpecImportSourceFormat { + /** The inlined content of a specification document. */ + Inline = "inline", + /** The link to a specification document hosted on a publicly accessible internet address. */ + Link = "link" +} + +/** + * Defines values for ApiSpecImportSourceFormat. \ + * {@link KnownApiSpecImportSourceFormat} can be used interchangeably with ApiSpecImportSourceFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **inline**: The inlined content of a specification document. \ + * **link**: The link to a specification document hosted on a publicly accessible internet address. + */ +export type ApiSpecImportSourceFormat = string; + +/** Known values of {@link ApiSpecExportResultFormat} that the service accepts. */ +export enum KnownApiSpecExportResultFormat { + /** The inlined content of a specification document. */ + Inline = "inline", + /** The link to the result of the export operation. The URL is valid for 5 minutes. */ + Link = "link" +} + +/** + * Defines values for ApiSpecExportResultFormat. \ + * {@link KnownApiSpecExportResultFormat} can be used interchangeably with ApiSpecExportResultFormat, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **inline**: The inlined content of a specification document. \ + * **link**: The link to the result of the export operation. The URL is valid for 5 minutes. + */ +export type ApiSpecExportResultFormat = string; + +/** Known values of {@link DeploymentState} that the service accepts. */ +export enum KnownDeploymentState { + /** Active */ + Active = "active", + /** Inactive */ + Inactive = "inactive" +} + +/** + * Defines values for DeploymentState. \ + * {@link KnownDeploymentState} can be used interchangeably with DeploymentState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **active** \ + * **inactive** + */ +export type DeploymentState = string; + +/** Known values of {@link EnvironmentType} that the service accepts. */ +export enum KnownEnvironmentType { + /** Development */ + Development = "development", + /** Testing */ + Testing = "testing", + /** Staging */ + Staging = "staging", + /** Production */ + Production = "production" +} + +/** + * Defines values for EnvironmentType. \ + * {@link KnownEnvironmentType} can be used interchangeably with EnvironmentType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **development** \ + * **testing** \ + * **staging** \ + * **production** + */ +export type EnvironmentType = string; + +/** Known values of {@link EnvironmentServerType} that the service accepts. */ +export enum KnownEnvironmentServerType { + /** AzureAPIManagement */ + AzureAPIManagement = "Azure API Management", + /** AzureComputeService */ + AzureComputeService = "Azure compute service", + /** ApigeeAPIManagement */ + ApigeeAPIManagement = "Apigee API Management", + /** AWSAPIGateway */ + AWSAPIGateway = "AWS API Gateway", + /** KongAPIGateway */ + KongAPIGateway = "Kong API Gateway", + /** Kubernetes */ + Kubernetes = "Kubernetes", + /** MuleSoftAPIManagement */ + MuleSoftAPIManagement = "MuleSoft API Management" +} + +/** + * Defines values for EnvironmentServerType. \ + * {@link KnownEnvironmentServerType} can be used interchangeably with EnvironmentServerType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Azure API Management** \ + * **Azure compute service** \ + * **Apigee API Management** \ + * **AWS API Gateway** \ + * **Kong API Gateway** \ + * **Kubernetes** \ + * **MuleSoft API Management** + */ +export type EnvironmentServerType = string; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -375,7 +969,7 @@ export type ServicesGetResponse = Service; export interface ServicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { /** The service entity. */ - resource?: Service; + payload?: Service; } /** Contains response data for the createOrUpdate operation. */ @@ -385,7 +979,7 @@ export type ServicesCreateOrUpdateResponse = Service; export interface ServicesUpdateOptionalParams extends coreClient.OperationOptions { /** The service properties to be updated. */ - parameters?: ServiceUpdate; + payload?: ServiceUpdate; } /** Contains response data for the update operation. */ @@ -395,6 +989,13 @@ export type ServicesUpdateResponse = Service; export interface ServicesDeleteOptionalParams extends coreClient.OperationOptions {} +/** Optional parameters. */ +export interface ServicesExportMetadataSchemaOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the exportMetadataSchema operation. */ +export type ServicesExportMetadataSchemaResponse = MetadataSchemaExportResult; + /** Optional parameters. */ export interface ServicesListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} @@ -409,6 +1010,308 @@ export interface ServicesListByResourceGroupNextOptionalParams /** Contains response data for the listByResourceGroupNext operation. */ export type ServicesListByResourceGroupNextResponse = ServiceCollection; +/** Optional parameters. */ +export interface MetadataSchemasListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type MetadataSchemasListResponse = MetadataSchemaCollection; + +/** Optional parameters. */ +export interface MetadataSchemasGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MetadataSchemasGetResponse = MetadataSchemasGetHeaders & + MetadataSchema; + +/** Optional parameters. */ +export interface MetadataSchemasCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type MetadataSchemasCreateOrUpdateResponse = MetadataSchemasCreateOrUpdateHeaders & + MetadataSchema; + +/** Optional parameters. */ +export interface MetadataSchemasDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface MetadataSchemasHeadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the head operation. */ +export type MetadataSchemasHeadResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface MetadataSchemasListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type MetadataSchemasListNextResponse = MetadataSchemaCollection; + +/** Optional parameters. */ +export interface WorkspacesListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type WorkspacesListResponse = WorkspaceCollection; + +/** Optional parameters. */ +export interface WorkspacesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type WorkspacesGetResponse = WorkspacesGetHeaders & Workspace; + +/** Optional parameters. */ +export interface WorkspacesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type WorkspacesCreateOrUpdateResponse = WorkspacesCreateOrUpdateHeaders & + Workspace; + +/** Optional parameters. */ +export interface WorkspacesDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface WorkspacesHeadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the head operation. */ +export type WorkspacesHeadResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface WorkspacesListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type WorkspacesListNextResponse = WorkspaceCollection; + +/** Optional parameters. */ +export interface ApisListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ApisListResponse = ApiCollection; + +/** Optional parameters. */ +export interface ApisGetOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ApisGetResponse = ApisGetHeaders & Api; + +/** Optional parameters. */ +export interface ApisCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ApisCreateOrUpdateResponse = ApisCreateOrUpdateHeaders & Api; + +/** Optional parameters. */ +export interface ApisDeleteOptionalParams extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ApisHeadOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the head operation. */ +export type ApisHeadResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface ApisListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ApisListNextResponse = ApiCollection; + +/** Optional parameters. */ +export interface ApiVersionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ApiVersionsListResponse = ApiVersionCollection; + +/** Optional parameters. */ +export interface ApiVersionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ApiVersionsGetResponse = ApiVersionsGetHeaders & ApiVersion; + +/** Optional parameters. */ +export interface ApiVersionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ApiVersionsCreateOrUpdateResponse = ApiVersionsCreateOrUpdateHeaders & + ApiVersion; + +/** Optional parameters. */ +export interface ApiVersionsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ApiVersionsHeadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the head operation. */ +export type ApiVersionsHeadResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface ApiVersionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ApiVersionsListNextResponse = ApiVersionCollection; + +/** Optional parameters. */ +export interface ApiDefinitionsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ApiDefinitionsListResponse = ApiDefinitionCollection; + +/** Optional parameters. */ +export interface ApiDefinitionsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ApiDefinitionsGetResponse = ApiDefinitionsGetHeaders & + ApiDefinition; + +/** Optional parameters. */ +export interface ApiDefinitionsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ApiDefinitionsCreateOrUpdateResponse = ApiDefinitionsCreateOrUpdateHeaders & + ApiDefinition; + +/** Optional parameters. */ +export interface ApiDefinitionsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ApiDefinitionsHeadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the head operation. */ +export type ApiDefinitionsHeadResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface ApiDefinitionsImportSpecificationOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ApiDefinitionsExportSpecificationOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the exportSpecification operation. */ +export type ApiDefinitionsExportSpecificationResponse = ApiSpecExportResult; + +/** Optional parameters. */ +export interface ApiDefinitionsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ApiDefinitionsListNextResponse = ApiDefinitionCollection; + +/** Optional parameters. */ +export interface DeploymentsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type DeploymentsListResponse = DeploymentCollection; + +/** Optional parameters. */ +export interface DeploymentsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface DeploymentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type DeploymentsGetResponse = DeploymentsGetHeaders & Deployment; + +/** Optional parameters. */ +export interface DeploymentsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type DeploymentsCreateOrUpdateResponse = DeploymentsCreateOrUpdateHeaders & + Deployment; + +/** Optional parameters. */ +export interface DeploymentsHeadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the head operation. */ +export type DeploymentsHeadResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface DeploymentsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type DeploymentsListNextResponse = DeploymentCollection; + +/** Optional parameters. */ +export interface EnvironmentsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type EnvironmentsListResponse = EnvironmentCollection; + +/** Optional parameters. */ +export interface EnvironmentsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type EnvironmentsCreateOrUpdateResponse = EnvironmentsCreateOrUpdateHeaders & + Environment; + +/** Optional parameters. */ +export interface EnvironmentsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface EnvironmentsHeadOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the head operation. */ +export type EnvironmentsHeadResponse = { + body: boolean; +}; + +/** Optional parameters. */ +export interface EnvironmentsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type EnvironmentsGetResponse = EnvironmentsGetHeaders & Environment; + +/** Optional parameters. */ +export interface EnvironmentsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type EnvironmentsListNextResponse = EnvironmentCollection; + /** Optional parameters. */ export interface AzureAPICenterOptionalParams extends coreClient.ServiceClientOptions { @@ -416,6 +1319,8 @@ export interface AzureAPICenterOptionalParams $host?: string; /** Api Version */ apiVersion?: string; + /** OData filter parameter. */ + filter?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/apicenter/arm-apicenter/src/models/mappers.ts b/sdk/apicenter/arm-apicenter/src/models/mappers.ts index 1e186610f695..fd52dc05cf4f 100644 --- a/sdk/apicenter/arm-apicenter/src/models/mappers.ts +++ b/sdk/apicenter/arm-apicenter/src/models/mappers.ts @@ -402,25 +402,923 @@ export const ServiceUpdate: coreClient.CompositeMapper = { } }; +export const MetadataSchemaExportResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataSchemaExportResult", + modelProperties: { + format: { + serializedName: "format", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const MetadataSchemaCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataSchemaCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataSchema" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const MetadataAssignment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataAssignment", + modelProperties: { + entity: { + serializedName: "entity", + type: { + name: "String" + } + }, + required: { + serializedName: "required", + type: { + name: "Boolean" + } + }, + deprecated: { + serializedName: "deprecated", + type: { + name: "Boolean" + } + } + } + } +}; + +export const WorkspaceCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspaceCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Workspace" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ApiCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Api" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const TermsOfService: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "TermsOfService", + modelProperties: { + url: { + constraints: { + MaxLength: 200 + }, + serializedName: "url", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const ExternalDocumentation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ExternalDocumentation", + modelProperties: { + title: { + constraints: { + MaxLength: 50 + }, + serializedName: "title", + type: { + name: "String" + } + }, + description: { + constraints: { + MaxLength: 500 + }, + serializedName: "description", + type: { + name: "String" + } + }, + url: { + constraints: { + MaxLength: 200 + }, + serializedName: "url", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const Contact: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Contact", + modelProperties: { + name: { + constraints: { + MaxLength: 100 + }, + serializedName: "name", + type: { + name: "String" + } + }, + url: { + constraints: { + MaxLength: 200 + }, + serializedName: "url", + type: { + name: "String" + } + }, + email: { + constraints: { + MaxLength: 100 + }, + serializedName: "email", + type: { + name: "String" + } + } + } + } +}; + +export const License: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "License", + modelProperties: { + name: { + constraints: { + MaxLength: 100 + }, + serializedName: "name", + type: { + name: "String" + } + }, + url: { + constraints: { + MaxLength: 200 + }, + serializedName: "url", + type: { + name: "String" + } + }, + identifier: { + constraints: { + MaxLength: 50 + }, + serializedName: "identifier", + type: { + name: "String" + } + } + } + } +}; + +export const ApiVersionCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiVersionCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApiVersion" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ApiDefinitionCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiDefinitionCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ApiDefinition" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ApiDefinitionPropertiesSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiDefinitionPropertiesSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + version: { + serializedName: "version", + type: { + name: "String" + } + } + } + } +}; + +export const ApiSpecImportSource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiSpecImportSource", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "String" + } + }, + format: { + serializedName: "format", + type: { + name: "String" + } + }, + specification: { + serializedName: "specification", + type: { + name: "Composite", + className: "ApiSpecImportSourceSpecification" + } + } + } + } +}; + +export const ApiSpecImportSourceSpecification: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiSpecImportSourceSpecification", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const ApiSpecExportResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiSpecExportResult", + modelProperties: { + format: { + serializedName: "format", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Deployment" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentServer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentServer", + modelProperties: { + runtimeUri: { + serializedName: "runtimeUri", + type: { + name: "Sequence", + element: { + constraints: { + MaxLength: 200 + }, + type: { + name: "String" + } + } + } + } + } + } +}; + +export const EnvironmentCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentCollection", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Environment" + } + } + } + }, + count: { + serializedName: "count", + type: { + name: "Number" + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentServer: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentServer", + modelProperties: { + type: { + serializedName: "type", + type: { + name: "String" + } + }, + managementPortalUri: { + constraints: { + MaxItems: 1 + }, + serializedName: "managementPortalUri", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const Onboarding: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Onboarding", + modelProperties: { + instructions: { + serializedName: "instructions", + type: { + name: "String" + } + }, + developerPortalUri: { + constraints: { + MaxItems: 1 + }, + serializedName: "developerPortalUri", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "TrackedResource", + className: "TrackedResource", + modelProperties: { + ...Resource.type.modelProperties, + tags: { + serializedName: "tags", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + location: { + serializedName: "location", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MetadataSchema: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataSchema", + modelProperties: { + ...Resource.type.modelProperties, + schema: { + serializedName: "properties.schema", + type: { + name: "String" + } + }, + assignedTo: { + serializedName: "properties.assignedTo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "MetadataAssignment" + } + } + } + } + } + } +}; + +export const Workspace: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Workspace", + modelProperties: { + ...Resource.type.modelProperties, + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + } + } + } +}; + +export const Api: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Api", + modelProperties: { + ...Resource.type.modelProperties, + title: { + constraints: { + MaxLength: 50 + }, + serializedName: "properties.title", + type: { + name: "String" + } + }, + typePropertiesType: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + description: { + constraints: { + MaxLength: 1000 + }, + serializedName: "properties.description", + type: { + name: "String" + } + }, + summary: { + constraints: { + MaxLength: 200 + }, + serializedName: "properties.summary", + type: { + name: "String" + } + }, + lifecycleStage: { + serializedName: "properties.lifecycleStage", + readOnly: true, + type: { + name: "String" + } + }, + termsOfService: { + serializedName: "properties.termsOfService", + type: { + name: "Composite", + className: "TermsOfService" + } + }, + externalDocumentation: { + constraints: { + MaxItems: 20 + }, + serializedName: "properties.externalDocumentation", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ExternalDocumentation" + } + } + } + }, + contacts: { + serializedName: "properties.contacts", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Contact" + } + } + } + }, + license: { + serializedName: "properties.license", + type: { + name: "Composite", + className: "License" + } + }, + customProperties: { + serializedName: "properties.customProperties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + } + } + } +}; + +export const ApiVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiVersion", modelProperties: { ...Resource.type.modelProperties, - tags: { - serializedName: "tags", + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + lifecycleStage: { + serializedName: "properties.lifecycleStage", + type: { + name: "String" + } + } + } + } +}; + +export const ApiDefinition: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiDefinition", + modelProperties: { + ...Resource.type.modelProperties, + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + specification: { + serializedName: "properties.specification", + type: { + name: "Composite", + className: "ApiDefinitionPropertiesSpecification" + } + } + } + } +}; + +export const Deployment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Deployment", + modelProperties: { + ...Resource.type.modelProperties, + title: { + serializedName: "properties.title", + type: { + name: "String" + } + }, + description: { + constraints: { + MaxLength: 500 + }, + serializedName: "properties.description", + type: { + name: "String" + } + }, + environmentId: { + serializedName: "properties.environmentId", + type: { + name: "String" + } + }, + definitionId: { + serializedName: "properties.definitionId", + type: { + name: "String" + } + }, + state: { + serializedName: "properties.state", + type: { + name: "String" + } + }, + server: { + serializedName: "properties.server", + type: { + name: "Composite", + className: "DeploymentServer" + } + }, + customProperties: { + serializedName: "properties.customProperties", type: { name: "Dictionary", - value: { type: { name: "String" } } + value: { type: { name: "any" } } + } + } + } + } +}; + +export const Environment: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Environment", + modelProperties: { + ...Resource.type.modelProperties, + title: { + serializedName: "properties.title", + type: { + name: "String" } }, - location: { - serializedName: "location", - required: true, + description: { + serializedName: "properties.description", + type: { + name: "String" + } + }, + typePropertiesType: { + serializedName: "properties.type", type: { name: "String" } + }, + server: { + serializedName: "properties.server", + type: { + name: "Composite", + className: "EnvironmentServer" + } + }, + onboarding: { + serializedName: "properties.onboarding", + type: { + name: "Composite", + className: "Onboarding" + } + }, + customProperties: { + serializedName: "properties.customProperties", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } @@ -449,3 +1347,213 @@ export const Service: coreClient.CompositeMapper = { } } }; + +export const MetadataSchemasGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataSchemasGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const MetadataSchemasCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MetadataSchemasCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const WorkspacesGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspacesGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const WorkspacesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "WorkspacesCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ApisGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApisGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ApisCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApisCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ApiVersionsGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiVersionsGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ApiVersionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiVersionsCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ApiDefinitionsGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiDefinitionsGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const ApiDefinitionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ApiDefinitionsCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentsGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentsGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const DeploymentsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DeploymentsCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentsCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentsCreateOrUpdateHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; + +export const EnvironmentsGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "EnvironmentsGetHeaders", + modelProperties: { + eTag: { + serializedName: "etag", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/apicenter/arm-apicenter/src/models/parameters.ts b/sdk/apicenter/arm-apicenter/src/models/parameters.ts index 86e9268ecae7..735c9d9b74ba 100644 --- a/sdk/apicenter/arm-apicenter/src/models/parameters.ts +++ b/sdk/apicenter/arm-apicenter/src/models/parameters.ts @@ -13,7 +13,15 @@ import { } from "@azure/core-client"; import { Service as ServiceMapper, - ServiceUpdate as ServiceUpdateMapper + ServiceUpdate as ServiceUpdateMapper, + MetadataSchema as MetadataSchemaMapper, + Workspace as WorkspaceMapper, + Api as ApiMapper, + ApiVersion as ApiVersionMapper, + ApiDefinition as ApiDefinitionMapper, + ApiSpecImportSource as ApiSpecImportSourceMapper, + Deployment as DeploymentMapper, + Environment as EnvironmentMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -43,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-07-01-preview", + defaultValue: "2024-03-01", isConstant: true, serializedName: "api-version", type: { @@ -67,13 +75,10 @@ export const nextLink: OperationURLParameter = { export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { - constraints: { - MinLength: 1 - }, serializedName: "subscriptionId", required: true, type: { - name: "String" + name: "Uuid" } } }; @@ -119,12 +124,171 @@ export const contentType: OperationParameter = { } }; -export const resource: OperationParameter = { - parameterPath: ["options", "resource"], +export const payload: OperationParameter = { + parameterPath: ["options", "payload"], mapper: ServiceMapper }; -export const parameters: OperationParameter = { - parameterPath: ["options", "parameters"], +export const payload1: OperationParameter = { + parameterPath: ["options", "payload"], mapper: ServiceUpdateMapper }; + +export const assignedTo: OperationQueryParameter = { + parameterPath: "assignedTo", + mapper: { + serializedName: "assignedTo", + required: true, + type: { + name: "String" + } + } +}; + +export const filter: OperationQueryParameter = { + parameterPath: "filter", + mapper: { + serializedName: "$filter", + type: { + name: "String" + } + } +}; + +export const metadataSchemaName: OperationURLParameter = { + parameterPath: "metadataSchemaName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "metadataSchemaName", + required: true, + type: { + name: "String" + } + } +}; + +export const payload2: OperationParameter = { + parameterPath: "payload", + mapper: MetadataSchemaMapper +}; + +export const workspaceName: OperationURLParameter = { + parameterPath: "workspaceName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "workspaceName", + required: true, + type: { + name: "String" + } + } +}; + +export const payload3: OperationParameter = { + parameterPath: "payload", + mapper: WorkspaceMapper +}; + +export const apiName: OperationURLParameter = { + parameterPath: "apiName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "apiName", + required: true, + type: { + name: "String" + } + } +}; + +export const payload4: OperationParameter = { + parameterPath: "payload", + mapper: ApiMapper +}; + +export const versionName: OperationURLParameter = { + parameterPath: "versionName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "versionName", + required: true, + type: { + name: "String" + } + } +}; + +export const payload5: OperationParameter = { + parameterPath: "payload", + mapper: ApiVersionMapper +}; + +export const definitionName: OperationURLParameter = { + parameterPath: "definitionName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "definitionName", + required: true, + type: { + name: "String" + } + } +}; + +export const payload6: OperationParameter = { + parameterPath: "payload", + mapper: ApiDefinitionMapper +}; + +export const payload7: OperationParameter = { + parameterPath: "payload", + mapper: ApiSpecImportSourceMapper +}; + +export const deploymentName: OperationURLParameter = { + parameterPath: "deploymentName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "deploymentName", + required: true, + type: { + name: "String" + } + } +}; + +export const payload8: OperationParameter = { + parameterPath: "payload", + mapper: DeploymentMapper +}; + +export const payload9: OperationParameter = { + parameterPath: "payload", + mapper: EnvironmentMapper +}; + +export const environmentName: OperationURLParameter = { + parameterPath: "environmentName", + mapper: { + constraints: { + MinLength: 1 + }, + serializedName: "environmentName", + required: true, + type: { + name: "String" + } + } +}; diff --git a/sdk/apicenter/arm-apicenter/src/operations/apiDefinitions.ts b/sdk/apicenter/arm-apicenter/src/operations/apiDefinitions.ts new file mode 100644 index 000000000000..06de4c188910 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operations/apiDefinitions.ts @@ -0,0 +1,480 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ApiDefinitions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAPICenter } from "../azureAPICenter"; +import { + ApiDefinition, + ApiDefinitionsListNextOptionalParams, + ApiDefinitionsListOptionalParams, + ApiDefinitionsListResponse, + ApiDefinitionsGetOptionalParams, + ApiDefinitionsGetResponse, + ApiDefinitionsCreateOrUpdateOptionalParams, + ApiDefinitionsCreateOrUpdateResponse, + ApiDefinitionsDeleteOptionalParams, + ApiDefinitionsHeadOptionalParams, + ApiDefinitionsHeadResponse, + ApiSpecImportSource, + ApiDefinitionsImportSpecificationOptionalParams, + ApiDefinitionsExportSpecificationOptionalParams, + ApiDefinitionsExportSpecificationResponse, + ApiDefinitionsListNextResponse +} from "../models"; + +/// +/** Class containing ApiDefinitions operations. */ +export class ApiDefinitionsImpl implements ApiDefinitions { + private readonly client: AzureAPICenter; + + /** + * Initialize a new instance of the class ApiDefinitions class. + * @param client Reference to the service client + */ + constructor(client: AzureAPICenter) { + this.client = client; + } + + /** + * Returns a collection of API definitions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ApiDefinitionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, serviceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Returns a collection of API definitions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listOperationSpec + ); + } + + /** + * Returns details of the API definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + getOperationSpec + ); + } + + /** + * Creates new or updates existing API definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API definition entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: ApiDefinition, + options?: ApiDefinitionsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes specified API definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + deleteOperationSpec + ); + } + + /** + * Checks if specified API definition exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsHeadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + headOperationSpec + ); + } + + /** + * Imports the API specification. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload The API specification source entity. + * @param options The options parameters. + */ + importSpecification( + resourceGroupName: string, + serviceName: string, + payload: ApiSpecImportSource, + options?: ApiDefinitionsImportSpecificationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + importSpecificationOperationSpec + ); + } + + /** + * Exports the API specification. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + exportSpecification( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsExportSpecificationOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + exportSpecificationOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: ApiDefinitionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiDefinitionCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiDefinition, + headersMapper: Mappers.ApiDefinitionsGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName, + Parameters.definitionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ApiDefinition, + headersMapper: Mappers.ApiDefinitionsCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.ApiDefinition, + headersMapper: Mappers.ApiDefinitionsCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload6, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName, + Parameters.definitionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName, + Parameters.definitionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const headOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}", + httpMethod: "HEAD", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName, + Parameters.definitionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const importSpecificationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}/importSpecification", + httpMethod: "POST", + responses: { + 200: {}, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload7, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName, + Parameters.definitionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const exportSpecificationOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}/definitions/{definitionName}/exportSpecification", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.ApiSpecExportResult + }, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName, + Parameters.definitionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiDefinitionCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apicenter/arm-apicenter/src/operations/apiVersions.ts b/sdk/apicenter/arm-apicenter/src/operations/apiVersions.ts new file mode 100644 index 000000000000..5a968d16ed9e --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operations/apiVersions.ts @@ -0,0 +1,380 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { ApiVersions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAPICenter } from "../azureAPICenter"; +import { + ApiVersion, + ApiVersionsListNextOptionalParams, + ApiVersionsListOptionalParams, + ApiVersionsListResponse, + ApiVersionsGetOptionalParams, + ApiVersionsGetResponse, + ApiVersionsCreateOrUpdateOptionalParams, + ApiVersionsCreateOrUpdateResponse, + ApiVersionsDeleteOptionalParams, + ApiVersionsHeadOptionalParams, + ApiVersionsHeadResponse, + ApiVersionsListNextResponse +} from "../models"; + +/// +/** Class containing ApiVersions operations. */ +export class ApiVersionsImpl implements ApiVersions { + private readonly client: AzureAPICenter; + + /** + * Initialize a new instance of the class ApiVersions class. + * @param client Reference to the service client + */ + constructor(client: AzureAPICenter) { + this.client = client; + } + + /** + * Returns a collection of API versions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ApiVersionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, serviceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Returns a collection of API versions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listOperationSpec + ); + } + + /** + * Returns details of the API version. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + getOperationSpec + ); + } + + /** + * Creates new or updates existing API version. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API version entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: ApiVersion, + options?: ApiVersionsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes specified API version + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + deleteOperationSpec + ); + } + + /** + * Checks if specified API version exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsHeadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + headOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: ApiVersionsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiVersionCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiVersion, + headersMapper: Mappers.ApiVersionsGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ApiVersion, + headersMapper: Mappers.ApiVersionsCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.ApiVersion, + headersMapper: Mappers.ApiVersionsCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload5, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const headOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/versions/{versionName}", + httpMethod: "HEAD", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.versionName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiVersionCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apicenter/arm-apicenter/src/operations/apis.ts b/sdk/apicenter/arm-apicenter/src/operations/apis.ts new file mode 100644 index 000000000000..257046e942bb --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operations/apis.ts @@ -0,0 +1,374 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Apis } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAPICenter } from "../azureAPICenter"; +import { + Api, + ApisListNextOptionalParams, + ApisListOptionalParams, + ApisListResponse, + ApisGetOptionalParams, + ApisGetResponse, + ApisCreateOrUpdateOptionalParams, + ApisCreateOrUpdateResponse, + ApisDeleteOptionalParams, + ApisHeadOptionalParams, + ApisHeadResponse, + ApisListNextResponse +} from "../models"; + +/// +/** Class containing Apis operations. */ +export class ApisImpl implements Apis { + private readonly client: AzureAPICenter; + + /** + * Initialize a new instance of the class Apis class. + * @param client Reference to the service client + */ + constructor(client: AzureAPICenter) { + this.client = client; + } + + /** + * Returns a collection of APIs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + serviceName: string, + options?: ApisListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + serviceName: string, + options?: ApisListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: ApisListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, serviceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + serviceName: string, + options?: ApisListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Returns a collection of APIs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + serviceName: string, + options?: ApisListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listOperationSpec + ); + } + + /** + * Returns details of the API. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: ApisGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + getOperationSpec + ); + } + + /** + * Creates new or updates existing API. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Api, + options?: ApisCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes specified API. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: ApisDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + deleteOperationSpec + ); + } + + /** + * Checks if specified API exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: ApisHeadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + headOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: ApisListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Api, + headersMapper: Mappers.ApisGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Api, + headersMapper: Mappers.ApisCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.Api, + headersMapper: Mappers.ApisCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload4, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept], + serializer +}; +const headOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}", + httpMethod: "HEAD", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ApiCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apicenter/arm-apicenter/src/operations/deployments.ts b/sdk/apicenter/arm-apicenter/src/operations/deployments.ts new file mode 100644 index 000000000000..4b7c6167a32e --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operations/deployments.ts @@ -0,0 +1,380 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Deployments } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAPICenter } from "../azureAPICenter"; +import { + Deployment, + DeploymentsListNextOptionalParams, + DeploymentsListOptionalParams, + DeploymentsListResponse, + DeploymentsDeleteOptionalParams, + DeploymentsGetOptionalParams, + DeploymentsGetResponse, + DeploymentsCreateOrUpdateOptionalParams, + DeploymentsCreateOrUpdateResponse, + DeploymentsHeadOptionalParams, + DeploymentsHeadResponse, + DeploymentsListNextResponse +} from "../models"; + +/// +/** Class containing Deployments operations. */ +export class DeploymentsImpl implements Deployments { + private readonly client: AzureAPICenter; + + /** + * Initialize a new instance of the class Deployments class. + * @param client Reference to the service client + */ + constructor(client: AzureAPICenter) { + this.client = client; + } + + /** + * Returns a collection of API deployments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: DeploymentsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, serviceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Returns a collection of API deployments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listOperationSpec + ); + } + + /** + * Deletes API deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + deleteOperationSpec + ); + } + + /** + * Returns details of the API deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + getOperationSpec + ); + } + + /** + * Creates new or updates existing API deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API deployment entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Deployment, + options?: DeploymentsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Checks if specified API deployment exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsHeadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + headOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: DeploymentsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/deployments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeploymentCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept], + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/deployments/{deploymentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/deployments/{deploymentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Deployment, + headersMapper: Mappers.DeploymentsGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/deployments/{deploymentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Deployment, + headersMapper: Mappers.DeploymentsCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.Deployment, + headersMapper: Mappers.DeploymentsCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const headOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apis/{apiName}/deployments/{deploymentName}", + httpMethod: "HEAD", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName, + Parameters.deploymentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.DeploymentCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.apiName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apicenter/arm-apicenter/src/operations/environments.ts b/sdk/apicenter/arm-apicenter/src/operations/environments.ts new file mode 100644 index 000000000000..782741bff51a --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operations/environments.ts @@ -0,0 +1,374 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Environments } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAPICenter } from "../azureAPICenter"; +import { + Environment, + EnvironmentsListNextOptionalParams, + EnvironmentsListOptionalParams, + EnvironmentsListResponse, + EnvironmentsCreateOrUpdateOptionalParams, + EnvironmentsCreateOrUpdateResponse, + EnvironmentsDeleteOptionalParams, + EnvironmentsHeadOptionalParams, + EnvironmentsHeadResponse, + EnvironmentsGetOptionalParams, + EnvironmentsGetResponse, + EnvironmentsListNextResponse +} from "../models"; + +/// +/** Class containing Environments operations. */ +export class EnvironmentsImpl implements Environments { + private readonly client: AzureAPICenter; + + /** + * Initialize a new instance of the class Environments class. + * @param client Reference to the service client + */ + constructor(client: AzureAPICenter) { + this.client = client; + } + + /** + * Returns a collection of environments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: EnvironmentsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, serviceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Returns a collection of environments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listOperationSpec + ); + } + + /** + * Creates new or updates existing environment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload Environment entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Environment, + options?: EnvironmentsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes the environment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + deleteOperationSpec + ); + } + + /** + * Checks if specified environment exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsHeadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + headOperationSpec + ); + } + + /** + * Returns details of the environment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + getOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: EnvironmentsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/environments", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnvironmentCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/environments/{environmentName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Environment, + headersMapper: Mappers.EnvironmentsCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.Environment, + headersMapper: Mappers.EnvironmentsCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.environmentName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/environments/{environmentName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.environmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const headOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/environments/{environmentName}", + httpMethod: "HEAD", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.environmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/environments/{environmentName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Environment, + headersMapper: Mappers.EnvironmentsGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName, + Parameters.environmentName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.EnvironmentCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apicenter/arm-apicenter/src/operations/index.ts b/sdk/apicenter/arm-apicenter/src/operations/index.ts index 8ea6c50645ed..2e1ee73fe33e 100644 --- a/sdk/apicenter/arm-apicenter/src/operations/index.ts +++ b/sdk/apicenter/arm-apicenter/src/operations/index.ts @@ -8,3 +8,10 @@ export * from "./operations"; export * from "./services"; +export * from "./metadataSchemas"; +export * from "./workspaces"; +export * from "./apis"; +export * from "./apiVersions"; +export * from "./apiDefinitions"; +export * from "./deployments"; +export * from "./environments"; diff --git a/sdk/apicenter/arm-apicenter/src/operations/metadataSchemas.ts b/sdk/apicenter/arm-apicenter/src/operations/metadataSchemas.ts new file mode 100644 index 000000000000..74e3221fae04 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operations/metadataSchemas.ts @@ -0,0 +1,368 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { MetadataSchemas } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAPICenter } from "../azureAPICenter"; +import { + MetadataSchema, + MetadataSchemasListNextOptionalParams, + MetadataSchemasListOptionalParams, + MetadataSchemasListResponse, + MetadataSchemasGetOptionalParams, + MetadataSchemasGetResponse, + MetadataSchemasCreateOrUpdateOptionalParams, + MetadataSchemasCreateOrUpdateResponse, + MetadataSchemasDeleteOptionalParams, + MetadataSchemasHeadOptionalParams, + MetadataSchemasHeadResponse, + MetadataSchemasListNextResponse +} from "../models"; + +/// +/** Class containing MetadataSchemas operations. */ +export class MetadataSchemasImpl implements MetadataSchemas { + private readonly client: AzureAPICenter; + + /** + * Initialize a new instance of the class MetadataSchemas class. + * @param client Reference to the service client + */ + constructor(client: AzureAPICenter) { + this.client = client; + } + + /** + * Returns a collection of metadata schemas. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: MetadataSchemasListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, serviceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Returns a collection of metadata schemas. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listOperationSpec + ); + } + + /** + * Returns details of the metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + getOperationSpec + ); + } + + /** + * Creates new or updates existing metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload Metadata schema entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: MetadataSchema, + options?: MetadataSchemasCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes specified metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + deleteOperationSpec + ); + } + + /** + * Checks if specified metadata schema exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasHeadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + headOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: MetadataSchemasListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/metadataSchemas", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MetadataSchemaCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/metadataSchemas/{metadataSchemaName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MetadataSchema, + headersMapper: Mappers.MetadataSchemasGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.metadataSchemaName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/metadataSchemas/{metadataSchemaName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.MetadataSchema, + headersMapper: Mappers.MetadataSchemasCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.MetadataSchema, + headersMapper: Mappers.MetadataSchemasCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload2, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.metadataSchemaName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/metadataSchemas/{metadataSchemaName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.metadataSchemaName + ], + headerParameters: [Parameters.accept], + serializer +}; +const headOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/metadataSchemas/{metadataSchemaName}", + httpMethod: "HEAD", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.metadataSchemaName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MetadataSchemaCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apicenter/arm-apicenter/src/operations/operations.ts b/sdk/apicenter/arm-apicenter/src/operations/operations.ts index c901c74ef9eb..4ef575e49b7a 100644 --- a/sdk/apicenter/arm-apicenter/src/operations/operations.ts +++ b/sdk/apicenter/arm-apicenter/src/operations/operations.ts @@ -35,7 +35,7 @@ export class OperationsImpl implements Operations { } /** - * List the operations for the provider + * Returns a collection of resource provider operations. * @param options The options parameters. */ public list( @@ -89,7 +89,7 @@ export class OperationsImpl implements Operations { } /** - * List the operations for the provider + * Returns a collection of resource provider operations. * @param options The options parameters. */ private _list( diff --git a/sdk/apicenter/arm-apicenter/src/operations/services.ts b/sdk/apicenter/arm-apicenter/src/operations/services.ts index d82b6d489c05..c4bdd2e26904 100644 --- a/sdk/apicenter/arm-apicenter/src/operations/services.ts +++ b/sdk/apicenter/arm-apicenter/src/operations/services.ts @@ -28,6 +28,9 @@ import { ServicesUpdateOptionalParams, ServicesUpdateResponse, ServicesDeleteOptionalParams, + MetadataAssignmentEntity, + ServicesExportMetadataSchemaOptionalParams, + ServicesExportMetadataSchemaResponse, ServicesListBySubscriptionNextResponse, ServicesListByResourceGroupNextResponse } from "../models"; @@ -100,7 +103,7 @@ export class ServicesImpl implements Services { } /** - * Lists services within a resource group + * Returns a collection of services within the resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ @@ -182,7 +185,7 @@ export class ServicesImpl implements Services { } /** - * Lists services within a resource group + * Returns a collection of services within the resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ @@ -197,7 +200,7 @@ export class ServicesImpl implements Services { } /** - * Get service + * Returns details of the service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -214,7 +217,7 @@ export class ServicesImpl implements Services { } /** - * Create or update service + * Creates new or updates existing API. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -231,7 +234,7 @@ export class ServicesImpl implements Services { } /** - * Update service + * Updates existing service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -248,7 +251,7 @@ export class ServicesImpl implements Services { } /** - * Delete service + * Deletes specified service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -264,6 +267,25 @@ export class ServicesImpl implements Services { ); } + /** + * Exports the effective metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param assignedTo An entity the metadata schema is requested for. + * @param options The options parameters. + */ + exportMetadataSchema( + resourceGroupName: string, + serviceName: string, + assignedTo: MetadataAssignmentEntity, + options?: ServicesExportMetadataSchemaOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, assignedTo, options }, + exportMetadataSchemaOperationSpec + ); + } + /** * ListBySubscriptionNext * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. @@ -374,7 +396,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.resource, + requestBody: Parameters.payload, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -398,7 +420,7 @@ const updateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - requestBody: Parameters.parameters, + requestBody: Parameters.payload1, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -431,6 +453,29 @@ const deleteOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const exportMetadataSchemaOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/exportMetadataSchema", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.MetadataSchemaExportResult + }, + 202: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.assignedTo], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName + ], + headerParameters: [Parameters.accept], + serializer +}; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/apicenter/arm-apicenter/src/operations/workspaces.ts b/sdk/apicenter/arm-apicenter/src/operations/workspaces.ts new file mode 100644 index 000000000000..df41bd701fb0 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operations/workspaces.ts @@ -0,0 +1,368 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { Workspaces } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureAPICenter } from "../azureAPICenter"; +import { + Workspace, + WorkspacesListNextOptionalParams, + WorkspacesListOptionalParams, + WorkspacesListResponse, + WorkspacesGetOptionalParams, + WorkspacesGetResponse, + WorkspacesCreateOrUpdateOptionalParams, + WorkspacesCreateOrUpdateResponse, + WorkspacesDeleteOptionalParams, + WorkspacesHeadOptionalParams, + WorkspacesHeadResponse, + WorkspacesListNextResponse +} from "../models"; + +/// +/** Class containing Workspaces operations. */ +export class WorkspacesImpl implements Workspaces { + private readonly client: AzureAPICenter; + + /** + * Initialize a new instance of the class Workspaces class. + * @param client Reference to the service client + */ + constructor(client: AzureAPICenter) { + this.client = client; + } + + /** + * Returns a collection of workspaces. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + public list( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(resourceGroupName, serviceName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + serviceName, + options, + settings + ); + } + }; + } + + private async *listPagingPage( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesListOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: WorkspacesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, serviceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listNext( + resourceGroupName, + serviceName, + continuationToken, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPagingAll( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage( + resourceGroupName, + serviceName, + options + )) { + yield* page; + } + } + + /** + * Returns a collection of workspaces. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + private _list( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + listOperationSpec + ); + } + + /** + * Returns details of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + getOperationSpec + ); + } + + /** + * Creates new or updates existing workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload Workspace entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Workspace, + options?: WorkspacesCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, payload, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes specified workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + deleteOperationSpec + ); + } + + /** + * Checks if specified workspace exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesHeadOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, options }, + headOperationSpec + ); + } + + /** + * ListNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + resourceGroupName: string, + serviceName: string, + nextLink: string, + options?: WorkspacesListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, serviceName, nextLink, options }, + listNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion, Parameters.filter], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.Workspace, + headersMapper: Mappers.WorkspacesGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.Workspace, + headersMapper: Mappers.WorkspacesCreateOrUpdateHeaders + }, + 201: { + bodyMapper: Mappers.Workspace, + headersMapper: Mappers.WorkspacesCreateOrUpdateHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.payload3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const headOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}", + httpMethod: "HEAD", + responses: { + 200: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName, + Parameters.workspaceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.WorkspaceCollection + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.serviceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apiDefinitions.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apiDefinitions.ts new file mode 100644 index 000000000000..f19e4246a454 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apiDefinitions.ts @@ -0,0 +1,110 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ApiDefinition, + ApiDefinitionsListOptionalParams, + ApiDefinitionsGetOptionalParams, + ApiDefinitionsGetResponse, + ApiDefinitionsCreateOrUpdateOptionalParams, + ApiDefinitionsCreateOrUpdateResponse, + ApiDefinitionsDeleteOptionalParams, + ApiDefinitionsHeadOptionalParams, + ApiDefinitionsHeadResponse, + ApiSpecImportSource, + ApiDefinitionsImportSpecificationOptionalParams, + ApiDefinitionsExportSpecificationOptionalParams, + ApiDefinitionsExportSpecificationResponse +} from "../models"; + +/// +/** Interface representing a ApiDefinitions. */ +export interface ApiDefinitions { + /** + * Returns a collection of API definitions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns details of the API definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsGetOptionalParams + ): Promise; + /** + * Creates new or updates existing API definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API definition entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: ApiDefinition, + options?: ApiDefinitionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes specified API definition. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsDeleteOptionalParams + ): Promise; + /** + * Checks if specified API definition exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsHeadOptionalParams + ): Promise; + /** + * Imports the API specification. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload The API specification source entity. + * @param options The options parameters. + */ + importSpecification( + resourceGroupName: string, + serviceName: string, + payload: ApiSpecImportSource, + options?: ApiDefinitionsImportSpecificationOptionalParams + ): Promise; + /** + * Exports the API specification. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + exportSpecification( + resourceGroupName: string, + serviceName: string, + options?: ApiDefinitionsExportSpecificationOptionalParams + ): Promise; +} diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apiVersions.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apiVersions.ts new file mode 100644 index 000000000000..5cc49af09a9b --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apiVersions.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ApiVersion, + ApiVersionsListOptionalParams, + ApiVersionsGetOptionalParams, + ApiVersionsGetResponse, + ApiVersionsCreateOrUpdateOptionalParams, + ApiVersionsCreateOrUpdateResponse, + ApiVersionsDeleteOptionalParams, + ApiVersionsHeadOptionalParams, + ApiVersionsHeadResponse +} from "../models"; + +/// +/** Interface representing a ApiVersions. */ +export interface ApiVersions { + /** + * Returns a collection of API versions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns details of the API version. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsGetOptionalParams + ): Promise; + /** + * Creates new or updates existing API version. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API version entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: ApiVersion, + options?: ApiVersionsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes specified API version + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsDeleteOptionalParams + ): Promise; + /** + * Checks if specified API version exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: ApiVersionsHeadOptionalParams + ): Promise; +} diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apis.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apis.ts new file mode 100644 index 000000000000..fe89520706f1 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/apis.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Api, + ApisListOptionalParams, + ApisGetOptionalParams, + ApisGetResponse, + ApisCreateOrUpdateOptionalParams, + ApisCreateOrUpdateResponse, + ApisDeleteOptionalParams, + ApisHeadOptionalParams, + ApisHeadResponse +} from "../models"; + +/// +/** Interface representing a Apis. */ +export interface Apis { + /** + * Returns a collection of APIs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceName: string, + options?: ApisListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns details of the API. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: ApisGetOptionalParams + ): Promise; + /** + * Creates new or updates existing API. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Api, + options?: ApisCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes specified API. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: ApisDeleteOptionalParams + ): Promise; + /** + * Checks if specified API exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: ApisHeadOptionalParams + ): Promise; +} diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/deployments.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/deployments.ts new file mode 100644 index 000000000000..238f3cbcd52f --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/deployments.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Deployment, + DeploymentsListOptionalParams, + DeploymentsDeleteOptionalParams, + DeploymentsGetOptionalParams, + DeploymentsGetResponse, + DeploymentsCreateOrUpdateOptionalParams, + DeploymentsCreateOrUpdateResponse, + DeploymentsHeadOptionalParams, + DeploymentsHeadResponse +} from "../models"; + +/// +/** Interface representing a Deployments. */ +export interface Deployments { + /** + * Returns a collection of API deployments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Deletes API deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsDeleteOptionalParams + ): Promise; + /** + * Returns details of the API deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsGetOptionalParams + ): Promise; + /** + * Creates new or updates existing API deployment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload API deployment entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Deployment, + options?: DeploymentsCreateOrUpdateOptionalParams + ): Promise; + /** + * Checks if specified API deployment exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: DeploymentsHeadOptionalParams + ): Promise; +} diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/environments.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/environments.ts new file mode 100644 index 000000000000..c75f3f497119 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/environments.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Environment, + EnvironmentsListOptionalParams, + EnvironmentsCreateOrUpdateOptionalParams, + EnvironmentsCreateOrUpdateResponse, + EnvironmentsDeleteOptionalParams, + EnvironmentsHeadOptionalParams, + EnvironmentsHeadResponse, + EnvironmentsGetOptionalParams, + EnvironmentsGetResponse +} from "../models"; + +/// +/** Interface representing a Environments. */ +export interface Environments { + /** + * Returns a collection of environments. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Creates new or updates existing environment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload Environment entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Environment, + options?: EnvironmentsCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes the environment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsDeleteOptionalParams + ): Promise; + /** + * Checks if specified environment exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsHeadOptionalParams + ): Promise; + /** + * Returns details of the environment. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: EnvironmentsGetOptionalParams + ): Promise; +} diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/index.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/index.ts index 8ea6c50645ed..2e1ee73fe33e 100644 --- a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/index.ts +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/index.ts @@ -8,3 +8,10 @@ export * from "./operations"; export * from "./services"; +export * from "./metadataSchemas"; +export * from "./workspaces"; +export * from "./apis"; +export * from "./apiVersions"; +export * from "./apiDefinitions"; +export * from "./deployments"; +export * from "./environments"; diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/metadataSchemas.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/metadataSchemas.ts new file mode 100644 index 000000000000..425f6c3fa762 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/metadataSchemas.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + MetadataSchema, + MetadataSchemasListOptionalParams, + MetadataSchemasGetOptionalParams, + MetadataSchemasGetResponse, + MetadataSchemasCreateOrUpdateOptionalParams, + MetadataSchemasCreateOrUpdateResponse, + MetadataSchemasDeleteOptionalParams, + MetadataSchemasHeadOptionalParams, + MetadataSchemasHeadResponse +} from "../models"; + +/// +/** Interface representing a MetadataSchemas. */ +export interface MetadataSchemas { + /** + * Returns a collection of metadata schemas. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns details of the metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasGetOptionalParams + ): Promise; + /** + * Creates new or updates existing metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload Metadata schema entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: MetadataSchema, + options?: MetadataSchemasCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes specified metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasDeleteOptionalParams + ): Promise; + /** + * Checks if specified metadata schema exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: MetadataSchemasHeadOptionalParams + ): Promise; +} diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/operations.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/operations.ts index 5cf5581845bd..50b00314300f 100644 --- a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/operations.ts +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/operations.ts @@ -13,7 +13,7 @@ import { Operation, OperationsListOptionalParams } from "../models"; /** Interface representing a Operations. */ export interface Operations { /** - * List the operations for the provider + * Returns a collection of resource provider operations. * @param options The options parameters. */ list( diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/services.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/services.ts index 2dbc51e5684a..34161a515996 100644 --- a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/services.ts +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/services.ts @@ -17,7 +17,10 @@ import { ServicesCreateOrUpdateResponse, ServicesUpdateOptionalParams, ServicesUpdateResponse, - ServicesDeleteOptionalParams + ServicesDeleteOptionalParams, + MetadataAssignmentEntity, + ServicesExportMetadataSchemaOptionalParams, + ServicesExportMetadataSchemaResponse } from "../models"; /// @@ -31,7 +34,7 @@ export interface Services { options?: ServicesListBySubscriptionOptionalParams ): PagedAsyncIterableIterator; /** - * Lists services within a resource group + * Returns a collection of services within the resource group. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param options The options parameters. */ @@ -40,7 +43,7 @@ export interface Services { options?: ServicesListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; /** - * Get service + * Returns details of the service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -51,7 +54,7 @@ export interface Services { options?: ServicesGetOptionalParams ): Promise; /** - * Create or update service + * Creates new or updates existing API. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -62,7 +65,7 @@ export interface Services { options?: ServicesCreateOrUpdateOptionalParams ): Promise; /** - * Update service + * Updates existing service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -73,7 +76,7 @@ export interface Services { options?: ServicesUpdateOptionalParams ): Promise; /** - * Delete service + * Deletes specified service. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param serviceName Service name * @param options The options parameters. @@ -83,4 +86,17 @@ export interface Services { serviceName: string, options?: ServicesDeleteOptionalParams ): Promise; + /** + * Exports the effective metadata schema. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param assignedTo An entity the metadata schema is requested for. + * @param options The options parameters. + */ + exportMetadataSchema( + resourceGroupName: string, + serviceName: string, + assignedTo: MetadataAssignmentEntity, + options?: ServicesExportMetadataSchemaOptionalParams + ): Promise; } diff --git a/sdk/apicenter/arm-apicenter/src/operationsInterfaces/workspaces.ts b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/workspaces.ts new file mode 100644 index 000000000000..3bd589404122 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/src/operationsInterfaces/workspaces.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + Workspace, + WorkspacesListOptionalParams, + WorkspacesGetOptionalParams, + WorkspacesGetResponse, + WorkspacesCreateOrUpdateOptionalParams, + WorkspacesCreateOrUpdateResponse, + WorkspacesDeleteOptionalParams, + WorkspacesHeadOptionalParams, + WorkspacesHeadResponse +} from "../models"; + +/// +/** Interface representing a Workspaces. */ +export interface Workspaces { + /** + * Returns a collection of workspaces. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + list( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Returns details of the workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + get( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesGetOptionalParams + ): Promise; + /** + * Creates new or updates existing workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param payload Workspace entity. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + serviceName: string, + payload: Workspace, + options?: WorkspacesCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes specified workspace. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesDeleteOptionalParams + ): Promise; + /** + * Checks if specified workspace exists. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param serviceName Service name + * @param options The options parameters. + */ + head( + resourceGroupName: string, + serviceName: string, + options?: WorkspacesHeadOptionalParams + ): Promise; +} diff --git a/sdk/apicenter/arm-apicenter/test/apicenter_operations_test.spec.ts b/sdk/apicenter/arm-apicenter/test/apicenter_operations_test.spec.ts deleted file mode 100644 index c371f3c0b9f5..000000000000 --- a/sdk/apicenter/arm-apicenter/test/apicenter_operations_test.spec.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { AzureAPICenter } from "../src/azureAPICenter"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("AzureAPICenter test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: AzureAPICenter; - let location: string; - let resourceGroup: string; - let resourceName: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new AzureAPICenter(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - resourceName = "testresource" - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("operation list test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - }); -}) diff --git a/sdk/apicenter/arm-apicenter/test/sampleTest.ts b/sdk/apicenter/arm-apicenter/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/apicenter/arm-apicenter/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/apicenter/arm-apicenter/tsconfig.json b/sdk/apicenter/arm-apicenter/tsconfig.json index eb48a45d313a..3e6ae96443f3 100644 --- a/sdk/apicenter/arm-apicenter/tsconfig.json +++ b/sdk/apicenter/arm-apicenter/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-apicenter": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"