diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 01e83e594538..2bc14d58f5f9 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13737,19 +13737,27 @@ packages: dev: false file:projects/arm-paloaltonetworksngfw.tgz: - resolution: {integrity: sha512-r3VJgW2RMWUTqfXmCsDbINsZPe8xgF2iEE3KbMj3AaQxDYfGgB+wo/TuDzb6JKs1t2xYCYdu0q7HINd3nx28Lw==, tarball: file:projects/arm-paloaltonetworksngfw.tgz} + resolution: {integrity: sha512-fKGZRdDNgr7mqDsIgzydlRchzXxTATpBcU584qlYa4b28zOfQPdoGxLYh1utGCaY/yfdf7HnYX6xsxV51pg73A==, tarball: file:projects/arm-paloaltonetworksngfw.tgz} name: '@rush-temp/arm-paloaltonetworksngfw' version: 0.0.0 dependencies: '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) + '@rollup/plugin-commonjs': 24.1.0(rollup@2.79.1) + '@rollup/plugin-json': 6.0.1(rollup@2.79.1) + '@rollup/plugin-multi-entry': 6.0.1(rollup@2.79.1) + '@rollup/plugin-node-resolve': 13.3.0(rollup@2.79.1) '@types/chai': 4.3.9 + '@types/mocha': 10.0.2 '@types/node': 16.18.58 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 + rollup: 2.79.1 + rollup-plugin-sourcemaps: 0.6.3(@types/node@16.18.58)(rollup@2.79.1) ts-node: 10.9.1(@types/node@16.18.58)(typescript@5.0.4) tslib: 2.6.2 typescript: 5.0.4 diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/CHANGELOG.md b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/CHANGELOG.md index afc5449ab9b0..e42a57e222ac 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/CHANGELOG.md +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/CHANGELOG.md @@ -1,15 +1,12 @@ # Release History - -## 1.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + +## 1.1.0 (2023-10-23) + +**Features** + + - Interface NetworkProfile has a new optional parameter trustedRanges + + ## 1.0.0 (2023-07-14) -The package of @azure/arm-paloaltonetworksngfw is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). +The package of @azure/arm-paloaltonetworksngfw 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/paloaltonetworksngfw/arm-paloaltonetworksngfw/_meta.json b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/_meta.json index e93171cda264..c1eccee76243 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/_meta.json +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/_meta.json @@ -1,8 +1,8 @@ { - "commit": "4c49a05d22106119afd2078a982f30855b91a010", + "commit": "4a4ff59826733a5da13f39e35cdb999c1f2e5093", "readme": "specification/paloaltonetworks/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\paloaltonetworks\\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/paloaltonetworks/resource-manager/readme.md --use=@autorest/typescript@^6.0.11", "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.11" } \ No newline at end of file diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/package.json b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/package.json index eecdf956bbf3..1ed4d56f4cba 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/package.json +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/package.json @@ -3,17 +3,17 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for PaloAltoNetworksCloudngfw.", - "version": "1.0.1", + "version": "1.1.0", "engines": { "node": ">=16.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.3", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@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": [ @@ -29,21 +29,29 @@ "types": "./types/arm-paloaltonetworksngfw.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^2.1.2", + "rollup": "^2.66.1", + "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-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^16.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -64,20 +72,21 @@ "src/**/*.ts", "README.md", "LICENSE", + "rollup.config.js", "tsconfig.json", "review/*", "CHANGELOG.md", "types/*" ], "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api", + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "prepack": "npm run build", "pack": "npm pack 2>&1", "extract-api": "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", @@ -105,13 +114,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-paloaltonetworksngfw?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw" +} \ No newline at end of file diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/review/arm-paloaltonetworksngfw.api.md b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/review/arm-paloaltonetworksngfw.api.md index 62deb99ce6d7..74dbf30eabe3 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/review/arm-paloaltonetworksngfw.api.md +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/review/arm-paloaltonetworksngfw.api.md @@ -1173,12 +1173,12 @@ export interface LocalRulestacks { getChangeLog(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksGetChangeLogOptionalParams): Promise; getSupportInfo(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksGetSupportInfoOptionalParams): Promise; listAdvancedSecurityObjects(resourceGroupName: string, localRulestackName: string, typeParam: AdvSecurityObjectTypeEnum, options?: LocalRulestacksListAdvancedSecurityObjectsOptionalParams): Promise; - listAppIds(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListAppIdsOptionalParams): Promise; + listAppIds(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListAppIdsOptionalParams): PagedAsyncIterableIterator; listByResourceGroup(resourceGroupName: string, options?: LocalRulestacksListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: LocalRulestacksListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - listCountries(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListCountriesOptionalParams): Promise; + listCountries(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListCountriesOptionalParams): PagedAsyncIterableIterator; listFirewalls(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListFirewallsOptionalParams): Promise; - listPredefinedUrlCategories(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams): Promise; + listPredefinedUrlCategories(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams): PagedAsyncIterableIterator; listSecurityServices(resourceGroupName: string, localRulestackName: string, typeParam: SecurityServicesTypeEnum, options?: LocalRulestacksListSecurityServicesOptionalParams): Promise; revert(resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksRevertOptionalParams): Promise; update(resourceGroupName: string, localRulestackName: string, properties: LocalRulestackResourceUpdate, options?: LocalRulestacksUpdateOptionalParams): Promise; @@ -1391,6 +1391,7 @@ export interface NetworkProfile { enableEgressNat: EgressNat; networkType: NetworkType; publicIps: IPAddress[]; + trustedRanges?: string[]; vnetConfiguration?: VnetConfiguration; vwanConfiguration?: VwanConfiguration; } diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/rollup.config.js b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/rollup.config.js @@ -0,0 +1,122 @@ +/* + * 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 nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/index.ts b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/index.ts index 3c973a925279..2308af916b89 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/index.ts +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/index.ts @@ -513,6 +513,8 @@ export interface NetworkProfile { enableEgressNat: EgressNat; /** Egress nat IP to use */ egressNatIp?: IPAddress[]; + /** Non-RFC 1918 address */ + trustedRanges?: string[]; } /** VnetInfo for Firewall Networking */ diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/mappers.ts b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/mappers.ts index 8c9495934d77..7e7f95e4dfa8 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/mappers.ts +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/mappers.ts @@ -1443,6 +1443,17 @@ export const NetworkProfile: coreClient.CompositeMapper = { } } } + }, + trustedRanges: { + serializedName: "trustedRanges", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/parameters.ts b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/parameters.ts index 2e7d70ea1d83..eab761c97e9d 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/parameters.ts +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/models/parameters.ts @@ -57,7 +57,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-08-29", + defaultValue: "2023-09-01", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operations/localRulestacks.ts b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operations/localRulestacks.ts index 728e6dd89aab..b02d350de601 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operations/localRulestacks.ts +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operations/localRulestacks.ts @@ -27,6 +27,14 @@ import { LocalRulestacksListByResourceGroupNextOptionalParams, LocalRulestacksListByResourceGroupOptionalParams, LocalRulestacksListByResourceGroupResponse, + LocalRulestacksListAppIdsOptionalParams, + LocalRulestacksListAppIdsResponse, + Country, + LocalRulestacksListCountriesOptionalParams, + LocalRulestacksListCountriesResponse, + PredefinedUrlCategory, + LocalRulestacksListPredefinedUrlCategoriesOptionalParams, + LocalRulestacksListPredefinedUrlCategoriesResponse, LocalRulestacksGetOptionalParams, LocalRulestacksGetResponse, LocalRulestacksCreateOrUpdateOptionalParams, @@ -43,14 +51,8 @@ import { AdvSecurityObjectTypeEnum, LocalRulestacksListAdvancedSecurityObjectsOptionalParams, LocalRulestacksListAdvancedSecurityObjectsResponse, - LocalRulestacksListAppIdsOptionalParams, - LocalRulestacksListAppIdsResponse, - LocalRulestacksListCountriesOptionalParams, - LocalRulestacksListCountriesResponse, LocalRulestacksListFirewallsOptionalParams, LocalRulestacksListFirewallsResponse, - LocalRulestacksListPredefinedUrlCategoriesOptionalParams, - LocalRulestacksListPredefinedUrlCategoriesResponse, SecurityServicesTypeEnum, LocalRulestacksListSecurityServicesOptionalParams, LocalRulestacksListSecurityServicesResponse, @@ -195,6 +197,255 @@ export class LocalRulestacksImpl implements LocalRulestacks { } } + /** + * List of AppIds for LocalRulestack ApiVersion + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param localRulestackName LocalRulestack resource name + * @param options The options parameters. + */ + public listAppIds( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListAppIdsOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listAppIdsPagingAll( + resourceGroupName, + localRulestackName, + 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.listAppIdsPagingPage( + resourceGroupName, + localRulestackName, + options, + settings + ); + } + }; + } + + private async *listAppIdsPagingPage( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListAppIdsOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: LocalRulestacksListAppIdsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAppIds( + resourceGroupName, + localRulestackName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listAppIds( + resourceGroupName, + localRulestackName, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listAppIdsPagingAll( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListAppIdsOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listAppIdsPagingPage( + resourceGroupName, + localRulestackName, + options + )) { + yield* page; + } + } + + /** + * List of countries for Rulestack + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param localRulestackName LocalRulestack resource name + * @param options The options parameters. + */ + public listCountries( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListCountriesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listCountriesPagingAll( + resourceGroupName, + localRulestackName, + 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.listCountriesPagingPage( + resourceGroupName, + localRulestackName, + options, + settings + ); + } + }; + } + + private async *listCountriesPagingPage( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListCountriesOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: LocalRulestacksListCountriesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listCountries( + resourceGroupName, + localRulestackName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listCountries( + resourceGroupName, + localRulestackName, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listCountriesPagingAll( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListCountriesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listCountriesPagingPage( + resourceGroupName, + localRulestackName, + options + )) { + yield* page; + } + } + + /** + * List predefined URL categories for rulestack + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param localRulestackName LocalRulestack resource name + * @param options The options parameters. + */ + public listPredefinedUrlCategories( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPredefinedUrlCategoriesPagingAll( + resourceGroupName, + localRulestackName, + 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.listPredefinedUrlCategoriesPagingPage( + resourceGroupName, + localRulestackName, + options, + settings + ); + } + }; + } + + private async *listPredefinedUrlCategoriesPagingPage( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: LocalRulestacksListPredefinedUrlCategoriesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listPredefinedUrlCategories( + resourceGroupName, + localRulestackName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listPredefinedUrlCategories( + resourceGroupName, + localRulestackName, + options + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listPredefinedUrlCategoriesPagingAll( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPredefinedUrlCategoriesPagingPage( + resourceGroupName, + localRulestackName, + options + )) { + yield* page; + } + } + /** * List LocalRulestackResource resources by subscription ID * @param options The options parameters. @@ -580,7 +831,7 @@ export class LocalRulestacksImpl implements LocalRulestacks { * @param localRulestackName LocalRulestack resource name * @param options The options parameters. */ - listAppIds( + private _listAppIds( resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListAppIdsOptionalParams @@ -597,7 +848,7 @@ export class LocalRulestacksImpl implements LocalRulestacks { * @param localRulestackName LocalRulestack resource name * @param options The options parameters. */ - listCountries( + private _listCountries( resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListCountriesOptionalParams @@ -631,7 +882,7 @@ export class LocalRulestacksImpl implements LocalRulestacks { * @param localRulestackName LocalRulestack resource name * @param options The options parameters. */ - listPredefinedUrlCategories( + private _listPredefinedUrlCategories( resourceGroupName: string, localRulestackName: string, options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operationsInterfaces/localRulestacks.ts b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operationsInterfaces/localRulestacks.ts index ef3662213c85..04b0a853e159 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operationsInterfaces/localRulestacks.ts +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/operationsInterfaces/localRulestacks.ts @@ -12,6 +12,11 @@ import { LocalRulestackResource, LocalRulestacksListBySubscriptionOptionalParams, LocalRulestacksListByResourceGroupOptionalParams, + LocalRulestacksListAppIdsOptionalParams, + Country, + LocalRulestacksListCountriesOptionalParams, + PredefinedUrlCategory, + LocalRulestacksListPredefinedUrlCategoriesOptionalParams, LocalRulestacksGetOptionalParams, LocalRulestacksGetResponse, LocalRulestacksCreateOrUpdateOptionalParams, @@ -28,14 +33,8 @@ import { AdvSecurityObjectTypeEnum, LocalRulestacksListAdvancedSecurityObjectsOptionalParams, LocalRulestacksListAdvancedSecurityObjectsResponse, - LocalRulestacksListAppIdsOptionalParams, - LocalRulestacksListAppIdsResponse, - LocalRulestacksListCountriesOptionalParams, - LocalRulestacksListCountriesResponse, LocalRulestacksListFirewallsOptionalParams, LocalRulestacksListFirewallsResponse, - LocalRulestacksListPredefinedUrlCategoriesOptionalParams, - LocalRulestacksListPredefinedUrlCategoriesResponse, SecurityServicesTypeEnum, LocalRulestacksListSecurityServicesOptionalParams, LocalRulestacksListSecurityServicesResponse, @@ -61,6 +60,39 @@ export interface LocalRulestacks { resourceGroupName: string, options?: LocalRulestacksListByResourceGroupOptionalParams ): PagedAsyncIterableIterator; + /** + * List of AppIds for LocalRulestack ApiVersion + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param localRulestackName LocalRulestack resource name + * @param options The options parameters. + */ + listAppIds( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListAppIdsOptionalParams + ): PagedAsyncIterableIterator; + /** + * List of countries for Rulestack + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param localRulestackName LocalRulestack resource name + * @param options The options parameters. + */ + listCountries( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListCountriesOptionalParams + ): PagedAsyncIterableIterator; + /** + * List predefined URL categories for rulestack + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param localRulestackName LocalRulestack resource name + * @param options The options parameters. + */ + listPredefinedUrlCategories( + resourceGroupName: string, + localRulestackName: string, + options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams + ): PagedAsyncIterableIterator; /** * Get a LocalRulestackResource * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -195,28 +227,6 @@ export interface LocalRulestacks { typeParam: AdvSecurityObjectTypeEnum, options?: LocalRulestacksListAdvancedSecurityObjectsOptionalParams ): Promise; - /** - * List of AppIds for LocalRulestack ApiVersion - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param localRulestackName LocalRulestack resource name - * @param options The options parameters. - */ - listAppIds( - resourceGroupName: string, - localRulestackName: string, - options?: LocalRulestacksListAppIdsOptionalParams - ): Promise; - /** - * List of countries for Rulestack - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param localRulestackName LocalRulestack resource name - * @param options The options parameters. - */ - listCountries( - resourceGroupName: string, - localRulestackName: string, - options?: LocalRulestacksListCountriesOptionalParams - ): Promise; /** * List of Firewalls associated with Rulestack * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -228,17 +238,6 @@ export interface LocalRulestacks { localRulestackName: string, options?: LocalRulestacksListFirewallsOptionalParams ): Promise; - /** - * List predefined URL categories for rulestack - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param localRulestackName LocalRulestack resource name - * @param options The options parameters. - */ - listPredefinedUrlCategories( - resourceGroupName: string, - localRulestackName: string, - options?: LocalRulestacksListPredefinedUrlCategoriesOptionalParams - ): Promise; /** * List the security services for rulestack * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/paloAltoNetworksCloudngfw.ts b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/paloAltoNetworksCloudngfw.ts index 7fe60b635523..ffb053c125f1 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/paloAltoNetworksCloudngfw.ts +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/src/paloAltoNetworksCloudngfw.ts @@ -94,7 +94,7 @@ export class PaloAltoNetworksCloudngfw extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-paloaltonetworksngfw/1.0.1`; + const packageDetails = `azsdk-js-arm-paloaltonetworksngfw/1.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -147,7 +147,7 @@ export class PaloAltoNetworksCloudngfw extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-08-29"; + this.apiVersion = options.apiVersion || "2023-09-01"; this.globalRulestack = new GlobalRulestackImpl(this); this.certificateObjectGlobalRulestack = new CertificateObjectGlobalRulestackImpl( this diff --git a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/test/sampleTest.ts b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/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/paloaltonetworksngfw/arm-paloaltonetworksngfw/tsconfig.json b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/tsconfig.json index ea67667a625b..3e6ae96443f3 100644 --- a/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/tsconfig.json +++ b/sdk/paloaltonetworksngfw/arm-paloaltonetworksngfw/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-paloaltonetworksngfw": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"