From 5571f520e9b4c1694d924e772b80e120c9ec9899 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 6 Jul 2022 02:59:19 +0000 Subject: [PATCH] CodeGen from PR 19673 in Azure/azure-rest-api-specs Merge e048bfa39a47f41ece39eba1db4249e2a9662b08 into 353d84dac009c19ae776c25eb361f07e85f26c8d --- sdk/policy/arm-policy/_meta.json | 8 ++-- sdk/policy/arm-policy/package.json | 17 ++------ .../arm-policy/review/arm-policy.api.md | 15 +++++++ sdk/policy/arm-policy/src/models/index.ts | 15 ------- sdk/policy/arm-policy/test/sampleTest.ts | 43 +++++++++++++++++++ sdk/policy/arm-policy/tsconfig.json | 11 ++--- 6 files changed, 70 insertions(+), 39 deletions(-) create mode 100644 sdk/policy/arm-policy/test/sampleTest.ts diff --git a/sdk/policy/arm-policy/_meta.json b/sdk/policy/arm-policy/_meta.json index 26f2bc9e5b97..43361be0cb16 100644 --- a/sdk/policy/arm-policy/_meta.json +++ b/sdk/policy/arm-policy/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ac155b972d0619a6e5bf665a863fb05ee7eeb30f", + "commit": "6ab7b389e84025ddb72fe56039265c5033357d97", "readme": "specification/resources/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:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\resources\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1 --generate-sample=true --azure-arm=true", + "autorest_command": "autorest --version=3.7.3 --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/resources/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.2", - "use": "@autorest/typescript@6.0.0-rc.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/policy/arm-policy/package.json b/sdk/policy/arm-policy/package.json index 628d3e928ba0..3ed4d9e21889 100644 --- a/sdk/policy/arm-policy/package.json +++ b/sdk/policy/arm-policy/package.json @@ -41,8 +41,6 @@ "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "@types/chai": "^4.2.8", - "chai": "^4.2.0", "cross-env": "^7.0.2", "@azure/dev-tool": "^1.0.0" }, @@ -96,7 +94,8 @@ "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "integration-test:browser": "echo skipped" + "integration-test:browser": "echo skipped", + "docs": "echo skipped" }, "sideEffects": false, "//metadata": { @@ -107,13 +106,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-policy?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/policy/arm-policy/review/arm-policy.api.md b/sdk/policy/arm-policy/review/arm-policy.api.md index 9f4426fc73ef..9e81f6d5e5d8 100644 --- a/sdk/policy/arm-policy/review/arm-policy.api.md +++ b/sdk/policy/arm-policy/review/arm-policy.api.md @@ -174,9 +174,13 @@ export enum KnownAliasPathTokenType { // @public export enum KnownCreatedByType { + // (undocumented) Application = "Application", + // (undocumented) Key = "Key", + // (undocumented) ManagedIdentity = "ManagedIdentity", + // (undocumented) User = "User" } @@ -194,20 +198,31 @@ export enum KnownExemptionCategory { // @public export enum KnownParameterType { + // (undocumented) Array = "Array", + // (undocumented) Boolean = "Boolean", + // (undocumented) DateTime = "DateTime", + // (undocumented) Float = "Float", + // (undocumented) Integer = "Integer", + // (undocumented) Object = "Object", + // (undocumented) String = "String" } // @public export enum KnownPolicyType { + // (undocumented) BuiltIn = "BuiltIn", + // (undocumented) Custom = "Custom", + // (undocumented) NotSpecified = "NotSpecified", + // (undocumented) Static = "Static" } diff --git a/sdk/policy/arm-policy/src/models/index.ts b/sdk/policy/arm-policy/src/models/index.ts index 3b908666e92e..cbc56dc1e1e7 100644 --- a/sdk/policy/arm-policy/src/models/index.ts +++ b/sdk/policy/arm-policy/src/models/index.ts @@ -579,13 +579,9 @@ export type EnforcementMode = string; /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { - /** User */ User = "User", - /** Application */ Application = "Application", - /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", - /** Key */ Key = "Key" } @@ -603,13 +599,9 @@ export type CreatedByType = string; /** Known values of {@link PolicyType} that the service accepts. */ export enum KnownPolicyType { - /** NotSpecified */ NotSpecified = "NotSpecified", - /** BuiltIn */ BuiltIn = "BuiltIn", - /** Custom */ Custom = "Custom", - /** Static */ Static = "Static" } @@ -627,19 +619,12 @@ export type PolicyType = string; /** Known values of {@link ParameterType} that the service accepts. */ export enum KnownParameterType { - /** String */ String = "String", - /** Array */ Array = "Array", - /** Object */ Object = "Object", - /** Boolean */ Boolean = "Boolean", - /** Integer */ Integer = "Integer", - /** Float */ Float = "Float", - /** DateTime */ DateTime = "DateTime" } diff --git a/sdk/policy/arm-policy/test/sampleTest.ts b/sdk/policy/arm-policy/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/policy/arm-policy/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/policy/arm-policy/tsconfig.json b/sdk/policy/arm-policy/tsconfig.json index bf4c4a024317..cd0af931e3e0 100644 --- a/sdk/policy/arm-policy/tsconfig.json +++ b/sdk/policy/arm-policy/tsconfig.json @@ -15,17 +15,14 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-policy": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts", + "./test/**/*.ts", + "./test/**/*.ts" ], "exclude": [ "node_modules"