Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions sdk/network/arm-network/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Release History

## 28.1.0 (2022-06-16)

**Features**

## 28.0.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes

- Type Alias ApplicationGatewayRoutingRule has a new parameter priority


## 28.0.0 (2022-05-18)

**Features**
Expand Down
8 changes: 4 additions & 4 deletions sdk/network/arm-network/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "ab66050afa716937d8bdefe3164380a4028700f8",
"commit": "4b6cc37a6b947d797562a9bc0fc84177316f9a0a",
"readme": "specification/network/resource-manager/readme.md",
"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",
"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",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.0",
"use": "@autorest/typescript@6.0.0-alpha.19.20220408.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.2",
"use": "@autorest/typescript@6.0.0-alpha.19.20220425.1"
}
22 changes: 8 additions & 14 deletions sdk/network/arm-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for NetworkManagementClient.",
"version": "28.0.1",
"version": "28.1.0",
"engines": {
"node": ">=12.0.0"
},
Expand Down Expand Up @@ -40,9 +40,11 @@
"uglify-js": "^3.4.9",
"rimraf": "^3.0.0",
"@azure/identity": "^2.0.1",
"@azure-tools/test-recorder": "^1.0.0",
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"cross-env": "^7.0.2"
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network",
"repository": {
Expand Down Expand Up @@ -93,7 +95,7 @@
"unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
"unit-test:browser": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js",
"integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
"integration-test:browser": "echo skipped",
"docs": "echo skipped"
},
Expand All @@ -106,13 +108,5 @@
}
]
},
"autoPublish": true,
"//sampleConfiguration": {
"productName": "",
"productSlugs": [
"azure"
],
"disableDocsMs": true,
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-network?view=azure-node-preview"
}
}
"autoPublish": true
}
1 change: 1 addition & 0 deletions sdk/network/arm-network/review/arm-network.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ export type ApplicationGatewayRoutingRule = SubResource & {
readonly etag?: string;
readonly type?: string;
ruleType?: ApplicationGatewayRequestRoutingRuleType;
priority?: number;
backendAddressPool?: SubResource;
backendSettings?: SubResource;
listener?: SubResource;
Expand Down
2 changes: 2 additions & 0 deletions sdk/network/arm-network/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6306,6 +6306,8 @@ export type ApplicationGatewayRoutingRule = SubResource & {
readonly type?: string;
/** Rule type. */
ruleType?: ApplicationGatewayRequestRoutingRuleType;
/** Priority of the routing rule. */
priority?: number;
/** Backend address pool resource of the application gateway. */
backendAddressPool?: SubResource;
/** Backend settings resource of the application gateway. */
Expand Down
10 changes: 10 additions & 0 deletions sdk/network/arm-network/src/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17269,6 +17269,16 @@ export const ApplicationGatewayRoutingRule: coreClient.CompositeMapper = {
name: "String"
}
},
priority: {
constraints: {
InclusiveMaximum: 20000,
InclusiveMinimum: 1
},
serializedName: "properties.priority",
type: {
name: "Number"
}
},
backendAddressPool: {
serializedName: "properties.backendAddressPool",
type: {
Expand Down
36 changes: 35 additions & 1 deletion sdk/network/arm-network/src/networkManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

import * as coreClient from "@azure/core-client";
import * as coreRestPipeline from "@azure/core-rest-pipeline";
import {
PipelineRequest,
PipelineResponse,
SendRequest
} from "@azure/core-rest-pipeline";
import * as coreAuth from "@azure/core-auth";
import { PagedAsyncIterableIterator } from "@azure/core-paging";
import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
Expand Down Expand Up @@ -313,7 +318,7 @@ export class NetworkManagementClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-network/28.0.1`;
const packageDetails = `azsdk-js-arm-network/28.1.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down Expand Up @@ -539,6 +544,35 @@ export class NetworkManagementClient extends coreClient.ServiceClient {
this.webApplicationFirewallPolicies = new WebApplicationFirewallPoliciesImpl(
this
);
this.addCustomApiVersionPolicy(options.apiVersion);
}

/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
private addCustomApiVersionPolicy(apiVersion?: string) {
if (!apiVersion) {
return;
}
const apiVersionPolicy = {
name: "CustomApiVersionPolicy",
async sendRequest(
request: PipelineRequest,
next: SendRequest
): Promise<PipelineResponse> {
const param = request.url.split("?");
if (param.length > 1) {
const newParams = param[1].split("&").map((item) => {
if (item.indexOf("api-version") > -1) {
return item.replace(/(?<==).*$/, apiVersion);
} else {
return item;
}
});
request.url = param[0] + "?" + newParams.join("&");
}
return next(request);
}
};
this.pipeline.addPolicy(apiVersionPolicy);
}

/**
Expand Down
43 changes: 43 additions & 0 deletions sdk/network/arm-network/test/sampleTest.ts
Original file line number Diff line number Diff line change
@@ -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<string, string> = {
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!");
});
});
10 changes: 2 additions & 8 deletions sdk/network/arm-network/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,11 @@
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true,
"paths": {
"@azure/arm-network": [
"./src/index"
]
}
"importHelpers": true
},
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"samples-dev/**/*.ts"
"./test/**/*.ts"
],
"exclude": [
"node_modules"
Expand Down