Skip to content

Commit ff4b8f0

Browse files
author
SDKAuto
committed
CodeGen from PR 20715 in Azure/azure-rest-api-specs
Merge 8d01c9609d0948cf0b6fdfe22ca8ec507d3a6008 into af1be2677e619e483210064ff658e62ec25053aa
1 parent 10e08b9 commit ff4b8f0

File tree

10 files changed

+89
-72
lines changed

10 files changed

+89
-72
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 8 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/redis/arm-rediscache/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+
## 8.0.0 (2022-09-14)
4+
5+
**Breaking Changes**
26

3-
## 7.0.1 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
7+
- Operation PatchSchedules.createOrUpdate has a new signature
8+
9+
1310
## 7.0.0 (2022-09-05)
1411

1512
**Features**
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"commit": "fbe1a37cc8f1e8d2dc31f781fffdbaef4c370fa6",
2+
"commit": "31e07db992a06ea70e020fee6c5ee53462f9615a",
33
"readme": "specification/redis/resource-manager/readme.md",
4-
"autorest_command": "autorest --version=3.8.4 --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\\redis\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true",
4+
"autorest_command": "autorest --version=3.8.4 --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/redis/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1",
55
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
66
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.2",
7-
"use": "@autorest/typescript@6.0.0-rc.1.20220727.1"
7+
"use": "@autorest/typescript@6.0.0-rc.1"
88
}

sdk/redis/arm-rediscache/package.json

Lines changed: 5 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 RedisManagementClient.",
6-
"version": "7.0.1",
6+
"version": "8.0.0",
77
"engines": {
88
"node": ">=12.0.0"
99
},
@@ -36,7 +36,7 @@
3636
"mkdirp": "^1.0.4",
3737
"rollup": "^2.66.1",
3838
"rollup-plugin-sourcemaps": "^0.6.3",
39-
"typescript": "~4.6.0",
39+
"typescript": "~4.2.0",
4040
"uglify-js": "^3.4.9",
4141
"rimraf": "^3.0.0",
4242
"@azure/identity": "^2.0.1",
@@ -46,8 +46,7 @@
4646
"@types/chai": "^4.2.8",
4747
"chai": "^4.2.0",
4848
"cross-env": "^7.0.2",
49-
"@azure/dev-tool": "^1.0.0",
50-
"@azure/arm-network": "^26.0.0"
49+
"@azure/dev-tool": "^1.0.0"
5150
},
5251
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache",
5352
"repository": {
@@ -110,13 +109,5 @@
110109
}
111110
]
112111
},
113-
"autoPublish": true,
114-
"//sampleConfiguration": {
115-
"productName": "",
116-
"productSlugs": [
117-
"azure"
118-
],
119-
"disableDocsMs": true,
120-
"apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview"
121-
}
122-
}
112+
"autoPublish": true
113+
}

sdk/redis/arm-rediscache/review/arm-rediscache.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export interface OperationStatusResult {
322322

323323
// @public
324324
export interface PatchSchedules {
325-
createOrUpdate(resourceGroupName: string, name: string, defaultParam: DefaultName, parameters: RedisPatchSchedule, options?: PatchSchedulesCreateOrUpdateOptionalParams): Promise<PatchSchedulesCreateOrUpdateResponse>;
325+
createOrUpdate(resourceGroupName: string, name: string, parameters: RedisPatchSchedule, defaultParam: DefaultName, options?: PatchSchedulesCreateOrUpdateOptionalParams): Promise<PatchSchedulesCreateOrUpdateResponse>;
326326
delete(resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesDeleteOptionalParams): Promise<void>;
327327
get(resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesGetOptionalParams): Promise<PatchSchedulesGetResponse>;
328328
listByRedisResource(resourceGroupName: string, cacheName: string, options?: PatchSchedulesListByRedisResourceOptionalParams): PagedAsyncIterableIterator<RedisPatchSchedule>;

sdk/redis/arm-rediscache/src/operations/patchSchedules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ export class PatchSchedulesImpl implements PatchSchedules {
131131
* Create or replace the patching schedule for Redis cache.
132132
* @param resourceGroupName The name of the resource group.
133133
* @param name The name of the Redis cache.
134-
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
135134
* @param parameters Parameters to set the patching schedule for Redis cache.
135+
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
136136
* @param options The options parameters.
137137
*/
138138
createOrUpdate(
139139
resourceGroupName: string,
140140
name: string,
141-
defaultParam: DefaultName,
142141
parameters: RedisPatchSchedule,
142+
defaultParam: DefaultName,
143143
options?: PatchSchedulesCreateOrUpdateOptionalParams
144144
): Promise<PatchSchedulesCreateOrUpdateResponse> {
145145
return this.client.sendOperationRequest(

sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ export interface PatchSchedules {
3636
* Create or replace the patching schedule for Redis cache.
3737
* @param resourceGroupName The name of the resource group.
3838
* @param name The name of the Redis cache.
39-
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
4039
* @param parameters Parameters to set the patching schedule for Redis cache.
40+
* @param defaultParam Default string modeled as parameter for auto generation to work correctly.
4141
* @param options The options parameters.
4242
*/
4343
createOrUpdate(
4444
resourceGroupName: string,
4545
name: string,
46-
defaultParam: DefaultName,
4746
parameters: RedisPatchSchedule,
47+
defaultParam: DefaultName,
4848
options?: PatchSchedulesCreateOrUpdateOptionalParams
4949
): Promise<PatchSchedulesCreateOrUpdateResponse>;
5050
/**

sdk/redis/arm-rediscache/src/redisManagementClient.ts

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class RedisManagementClient extends coreClient.ServiceClient {
6969
credential: credentials
7070
};
7171

72-
const packageDetails = `azsdk-js-arm-rediscache/7.0.1`;
72+
const packageDetails = `azsdk-js-arm-rediscache/8.0.0`;
7373
const userAgentPrefix =
7474
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
7575
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
@@ -89,34 +89,27 @@ export class RedisManagementClient extends coreClient.ServiceClient {
8989
};
9090
super(optionsWithDefaults);
9191

92-
let bearerTokenAuthenticationPolicyFound: boolean = false;
9392
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
9493
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
95-
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
94+
const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
9695
(pipelinePolicy) =>
9796
pipelinePolicy.name ===
9897
coreRestPipeline.bearerTokenAuthenticationPolicyName
9998
);
100-
}
101-
if (
102-
!options ||
103-
!options.pipeline ||
104-
options.pipeline.getOrderedPolicies().length == 0 ||
105-
!bearerTokenAuthenticationPolicyFound
106-
) {
107-
this.pipeline.removePolicy({
108-
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
109-
});
110-
this.pipeline.addPolicy(
111-
coreRestPipeline.bearerTokenAuthenticationPolicy({
112-
credential: credentials,
113-
scopes: `${optionsWithDefaults.credentialScopes}`,
114-
challengeCallbacks: {
115-
authorizeRequestOnChallenge:
116-
coreClient.authorizeRequestOnClaimChallenge
117-
}
118-
})
119-
);
99+
if (!bearerTokenAuthenticationPolicyFound) {
100+
this.pipeline.removePolicy({
101+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
102+
});
103+
this.pipeline.addPolicy(
104+
coreRestPipeline.bearerTokenAuthenticationPolicy({
105+
scopes: `${optionsWithDefaults.baseUri}/.default`,
106+
challengeCallbacks: {
107+
authorizeRequestOnChallenge:
108+
coreClient.authorizeRequestOnClaimChallenge
109+
}
110+
})
111+
);
112+
}
120113
}
121114
// Parameter assignments
122115
this.subscriptionId = subscriptionId;
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/redis/arm-rediscache/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-rediscache": [
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)