From f1425bfa6a911769b6959542c207665579efbecf Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 5 Sep 2023 15:24:14 +0000 Subject: [PATCH] CodeGen from PR 25517 in Azure/azure-rest-api-specs Merge 63933c0c0625c1fe8d421b79144e5aa658b2e1b3 into 9cff12e5e7e09f9f4479de7b626b856da501d665 --- sdk/redis/arm-rediscache/_meta.json | 8 ++-- sdk/redis/arm-rediscache/package.json | 21 +++------ sdk/redis/arm-rediscache/src/models/index.ts | 8 ++-- .../arm-rediscache/src/models/mappers.ts | 15 ------- sdk/redis/arm-rediscache/test/sampleTest.ts | 43 +++++++++++++++++++ sdk/redis/arm-rediscache/tsconfig.json | 10 +---- 6 files changed, 59 insertions(+), 46 deletions(-) create mode 100644 sdk/redis/arm-rediscache/test/sampleTest.ts diff --git a/sdk/redis/arm-rediscache/_meta.json b/sdk/redis/arm-rediscache/_meta.json index 76c040d3b3b9..8db13dcb7e1d 100644 --- a/sdk/redis/arm-rediscache/_meta.json +++ b/sdk/redis/arm-rediscache/_meta.json @@ -1,8 +1,8 @@ { - "commit": "a7db288cbce8b520781be6b23444fc895c4d6c81", + "commit": "60818fc41949189bba28772e764d7633c4bb35b9", "readme": "specification/redis/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\\redis\\resource-manager\\readme.md --use=@autorest/typescript@6.0.2 --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/redis/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.2" + "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/redis/arm-rediscache/package.json b/sdk/redis/arm-rediscache/package.json index 7f1b70cbdd93..ff1076f90255 100644 --- a/sdk/redis/arm-rediscache/package.json +++ b/sdk/redis/arm-rediscache/package.json @@ -8,12 +8,12 @@ "node": ">=14.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": [ @@ -48,9 +48,8 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-network": "^26.0.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -113,13 +112,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache" +} \ No newline at end of file diff --git a/sdk/redis/arm-rediscache/src/models/index.ts b/sdk/redis/arm-rediscache/src/models/index.ts index c8846c831e74..f762569961e5 100644 --- a/sdk/redis/arm-rediscache/src/models/index.ts +++ b/sdk/redis/arm-rediscache/src/models/index.ts @@ -152,7 +152,7 @@ export interface RedisCreateParameters { shardCount?: number; /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ + /** Whether or not public endpoint access is allowed for this cache. Value is optional, but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Note: This setting is important for caches with private endpoints. It has *no effect* on caches that are joined to, or injected into, a virtual network subnet. */ publicNetworkAccess?: PublicNetworkAccess; /** The SKU of the Redis cache to deploy. */ sku: Sku; @@ -190,7 +190,7 @@ export interface RedisCommonProperties { shardCount?: number; /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ + /** Whether or not public endpoint access is allowed for this cache. Value is optional, but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Note: This setting is important for caches with private endpoints. It has *no effect* on caches that are joined to, or injected into, a virtual network subnet. */ publicNetworkAccess?: PublicNetworkAccess; } @@ -392,7 +392,7 @@ export interface RedisUpdateParameters { shardCount?: number; /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ + /** Whether or not public endpoint access is allowed for this cache. Value is optional, but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Note: This setting is important for caches with private endpoints. It has *no effect* on caches that are joined to, or injected into, a virtual network subnet. */ publicNetworkAccess?: PublicNetworkAccess; /** The SKU of the Redis cache to deploy. */ sku?: Sku; @@ -742,7 +742,7 @@ export interface RedisResource extends TrackedResource { shardCount?: number; /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ + /** Whether or not public endpoint access is allowed for this cache. Value is optional, but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Note: This setting is important for caches with private endpoints. It has *no effect* on caches that are joined to, or injected into, a virtual network subnet. */ publicNetworkAccess?: PublicNetworkAccess; /** The SKU of the Redis cache to deploy. */ sku: Sku; diff --git a/sdk/redis/arm-rediscache/src/models/mappers.ts b/sdk/redis/arm-rediscache/src/models/mappers.ts index c37ce4bb0459..a5982af9efa9 100644 --- a/sdk/redis/arm-rediscache/src/models/mappers.ts +++ b/sdk/redis/arm-rediscache/src/models/mappers.ts @@ -372,11 +372,6 @@ export const RedisCreateParameters: coreClient.CompositeMapper = { } }, subnetId: { - constraints: { - Pattern: new RegExp( - "^\\/subscriptions\\/[^/]*\\/resourceGroups\\/[^/]*\\/providers\\/Microsoft.(ClassicNetwork|Network)\\/virtualNetworks\\/[^/]*\\/subnets\\/[^/]*$" - ) - }, serializedName: "properties.subnetId", type: { name: "String" @@ -1488,11 +1483,6 @@ export const RedisCreateProperties: coreClient.CompositeMapper = { } }, subnetId: { - constraints: { - Pattern: new RegExp( - "^\\/subscriptions\\/[^/]*\\/resourceGroups\\/[^/]*\\/providers\\/Microsoft.(ClassicNetwork|Network)\\/virtualNetworks\\/[^/]*\\/subnets\\/[^/]*$" - ) - }, serializedName: "subnetId", type: { name: "String" @@ -1841,11 +1831,6 @@ export const RedisResource: coreClient.CompositeMapper = { } }, subnetId: { - constraints: { - Pattern: new RegExp( - "^\\/subscriptions\\/[^/]*\\/resourceGroups\\/[^/]*\\/providers\\/Microsoft.(ClassicNetwork|Network)\\/virtualNetworks\\/[^/]*\\/subnets\\/[^/]*$" - ) - }, serializedName: "properties.subnetId", type: { name: "String" diff --git a/sdk/redis/arm-rediscache/test/sampleTest.ts b/sdk/redis/arm-rediscache/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/redis/arm-rediscache/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/redis/arm-rediscache/tsconfig.json b/sdk/redis/arm-rediscache/tsconfig.json index a52528a33769..3e6ae96443f3 100644 --- a/sdk/redis/arm-rediscache/tsconfig.json +++ b/sdk/redis/arm-rediscache/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-rediscache": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"