Skip to content

Commit 898b2aa

Browse files
author
SDKAuto
committed
CodeGen from PR 19152 in Azure/azure-rest-api-specs
Merge 52b886f696fe74624d3a0fc5c35cc62e22f11800 into ace0542cdd24df36b68203f754b1e7a4a1883014
1 parent 301b05a commit 898b2aa

File tree

9 files changed

+111
-36
lines changed

9 files changed

+111
-36
lines changed

sdk/network/arm-network/CHANGELOG.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# Release History
2+
3+
## 28.1.0 (2022-05-20)
4+
5+
**Features**
26

3-
## 28.0.1 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
7+
- Type Alias ApplicationGatewayRoutingRule has a new parameter priority
8+
9+
1310
## 28.0.0 (2022-05-18)
1411

1512
**Features**

sdk/network/arm-network/_meta.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"commit": "ab66050afa716937d8bdefe3164380a4028700f8",
2+
"commit": "69c04bebe1e138155642a05ca4b91f5f4b4e6fda",
33
"readme": "specification/network/resource-manager/readme.md",
4-
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\network\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true",
4+
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --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/network/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
66
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.0",
7-
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
7+
"use": "@autorest/typescript@6.0.0-alpha.19.20220425.1"
88
}

sdk/network/arm-network/package.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"sdk-type": "mgmt",
44
"author": "Microsoft Corporation",
55
"description": "A generated SDK for NetworkManagementClient.",
6-
"version": "28.0.1",
6+
"version": "28.1.0",
77
"engines": {
88
"node": ">=12.0.0"
99
},
@@ -40,9 +40,11 @@
4040
"uglify-js": "^3.4.9",
4141
"rimraf": "^3.0.0",
4242
"@azure/identity": "^2.0.1",
43-
"@azure-tools/test-recorder": "^1.0.0",
43+
"@azure-tools/test-recorder": "^2.0.0",
44+
"@azure-tools/test-credential": "^1.0.0",
4445
"mocha": "^7.1.1",
45-
"cross-env": "^7.0.2"
46+
"cross-env": "^7.0.2",
47+
"@azure/dev-tool": "^1.0.0"
4648
},
4749
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network",
4850
"repository": {
@@ -93,7 +95,7 @@
9395
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
9496
"unit-test:browser": "echo skipped",
9597
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
96-
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
98+
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
9799
"integration-test:browser": "echo skipped",
98100
"docs": "echo skipped"
99101
},
@@ -106,13 +108,5 @@
106108
}
107109
]
108110
},
109-
"autoPublish": true,
110-
"//sampleConfiguration": {
111-
"productName": "",
112-
"productSlugs": [
113-
"azure"
114-
],
115-
"disableDocsMs": true,
116-
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-network?view=azure-node-preview"
117-
}
118-
}
111+
"autoPublish": true
112+
}

sdk/network/arm-network/review/arm-network.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ export type ApplicationGatewayRoutingRule = SubResource & {
601601
readonly etag?: string;
602602
readonly type?: string;
603603
ruleType?: ApplicationGatewayRequestRoutingRuleType;
604+
priority?: number;
604605
backendAddressPool?: SubResource;
605606
backendSettings?: SubResource;
606607
listener?: SubResource;

sdk/network/arm-network/src/models/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6306,6 +6306,8 @@ export type ApplicationGatewayRoutingRule = SubResource & {
63066306
readonly type?: string;
63076307
/** Rule type. */
63086308
ruleType?: ApplicationGatewayRequestRoutingRuleType;
6309+
/** Priority of the routing rule. */
6310+
priority?: number;
63096311
/** Backend address pool resource of the application gateway. */
63106312
backendAddressPool?: SubResource;
63116313
/** Backend settings resource of the application gateway. */

sdk/network/arm-network/src/models/mappers.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17269,6 +17269,16 @@ export const ApplicationGatewayRoutingRule: coreClient.CompositeMapper = {
1726917269
name: "String"
1727017270
}
1727117271
},
17272+
priority: {
17273+
constraints: {
17274+
InclusiveMaximum: 20000,
17275+
InclusiveMinimum: 1
17276+
},
17277+
serializedName: "properties.priority",
17278+
type: {
17279+
name: "Number"
17280+
}
17281+
},
1727217282
backendAddressPool: {
1727317283
serializedName: "properties.backendAddressPool",
1727417284
type: {

sdk/network/arm-network/src/networkManagementClient.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
import * as coreClient from "@azure/core-client";
1010
import * as coreRestPipeline from "@azure/core-rest-pipeline";
11+
import {
12+
PipelineRequest,
13+
PipelineResponse,
14+
SendRequest
15+
} from "@azure/core-rest-pipeline";
1116
import * as coreAuth from "@azure/core-auth";
1217
import { PagedAsyncIterableIterator } from "@azure/core-paging";
1318
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
@@ -313,7 +318,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient {
313318
credential: credentials
314319
};
315320

316-
const packageDetails = `azsdk-js-arm-network/28.0.1`;
321+
const packageDetails = `azsdk-js-arm-network/28.1.0`;
317322
const userAgentPrefix =
318323
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
319324
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
@@ -539,6 +544,35 @@ export class NetworkManagementClient extends coreClient.ServiceClient {
539544
this.webApplicationFirewallPolicies = new WebApplicationFirewallPoliciesImpl(
540545
this
541546
);
547+
this.addCustomApiVersionPolicy(options.apiVersion);
548+
}
549+
550+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
551+
private addCustomApiVersionPolicy(apiVersion?: string) {
552+
if (!apiVersion) {
553+
return;
554+
}
555+
const apiVersionPolicy = {
556+
name: "CustomApiVersionPolicy",
557+
async sendRequest(
558+
request: PipelineRequest,
559+
next: SendRequest
560+
): Promise<PipelineResponse> {
561+
const param = request.url.split("?");
562+
if (param.length > 1) {
563+
const newParams = param[1].split("&").map((item) => {
564+
if (item.indexOf("api-version") > -1) {
565+
return item.replace(/(?<==).*$/, apiVersion);
566+
} else {
567+
return item;
568+
}
569+
});
570+
request.url = param[0] + "?" + newParams.join("&");
571+
}
572+
return next(request);
573+
}
574+
};
575+
this.pipeline.addPolicy(apiVersionPolicy);
542576
}
543577

544578
/**
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) Microsoft Corporation.
3+
* Licensed under the MIT License.
4+
*
5+
* Code generated by Microsoft (R) AutoRest Code Generator.
6+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
*/
8+
9+
import {
10+
Recorder,
11+
RecorderStartOptions,
12+
env
13+
} from "@azure-tools/test-recorder";
14+
import { assert } from "chai";
15+
import { Context } from "mocha";
16+
17+
const replaceableVariables: Record<string, string> = {
18+
AZURE_CLIENT_ID: "azure_client_id",
19+
AZURE_CLIENT_SECRET: "azure_client_secret",
20+
AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888",
21+
SUBSCRIPTION_ID: "azure_subscription_id"
22+
};
23+
24+
const recorderOptions: RecorderStartOptions = {
25+
envSetupForPlayback: replaceableVariables
26+
};
27+
28+
describe("My test", () => {
29+
let recorder: Recorder;
30+
31+
beforeEach(async function(this: Context) {
32+
recorder = new Recorder(this.currentTest);
33+
await recorder.start(recorderOptions);
34+
});
35+
36+
afterEach(async function() {
37+
await recorder.stop();
38+
});
39+
40+
it("sample test", async function() {
41+
console.log("Hi, I'm a test!");
42+
});
43+
});

sdk/network/arm-network/tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@
1515
],
1616
"declaration": true,
1717
"outDir": "./dist-esm",
18-
"importHelpers": true,
19-
"paths": {
20-
"@azure/arm-network": [
21-
"./src/index"
22-
]
23-
}
18+
"importHelpers": true
2419
},
2520
"include": [
2621
"./src/**/*.ts",
27-
"./test/**/*.ts",
28-
"samples-dev/**/*.ts"
22+
"./test/**/*.ts"
2923
],
3024
"exclude": [
3125
"node_modules"

0 commit comments

Comments
 (0)