Skip to content

Commit

Permalink
CodeGen from PR 18683 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge ef3e80f8a7d9d2ed9157410e7dfb1837bd1d35a3 into ba65174ad2569e80fdb5838a1dddc26b8c0d6f3d
  • Loading branch information
SDKAuto committed Apr 14, 2022
1 parent d3e2b7f commit 30f8d1f
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 153 deletions.
166 changes: 83 additions & 83 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/features/arm-features/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021 Microsoft
Copyright (c) 2022 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 4 additions & 3 deletions sdk/features/arm-features/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"commit": "a42f1b58607091c4f255ead152a8ef323fa0b280",
"commit": "5b972a5b66f6badad54c18e0466a140ddc4ed5e4",
"readme": "specification/resources/resource-manager/readme.md",
"autorest_command": "autorest --version=3.1.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\mydev\\azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/[email protected].20211130.1",
"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/resources/resource-manager/readme.md --use=@autorest/[email protected].20220105.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/[email protected]"
"release_tool": "@azure-tools/[email protected]",
"use": "@autorest/[email protected]"
}
25 changes: 19 additions & 6 deletions sdk/features/arm-features/api-extractor.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist-esm/src/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"docModel": {
"enabled": true
},
"apiReport": {
"enabled": true,
"reportFolder": "./review"
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/arm-features.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
},
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
"ae-missing-release-tag": {
"logLevel": "none"
},
"ae-unresolved-link": {
"logLevel": "none"
}
}
}
}
}
8 changes: 4 additions & 4 deletions sdk/features/arm-features/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 FeatureClient.",
"version": "3.0.1",
"version": "3.0.2",
"engines": {
"node": ">=12.0.0"
},
Expand All @@ -27,12 +27,12 @@
"types": "./types/arm-features.d.ts",
"devDependencies": {
"@microsoft/api-extractor": "^7.18.11",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-json": "^4.0.0",
"@rollup/plugin-multi-entry": "^3.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"mkdirp": "^1.0.4",
"rollup": "^2.0.0",
"rollup": "^1.16.3",
"rollup-plugin-sourcemaps": "^0.4.2",
"typescript": "~4.2.0",
"uglify-js": "^3.4.9",
Expand Down Expand Up @@ -97,4 +97,4 @@
},
"sideEffects": false,
"autoPublish": true
}
}
2 changes: 1 addition & 1 deletion sdk/features/arm-features/src/featureClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class FeatureClient extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-features/3.0.0`;
const packageDetails = `azsdk-js-arm-features/3.0.2`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down
52 changes: 4 additions & 48 deletions sdk/features/arm-features/test/sampleTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@ import {
env,
record,
RecorderEnvironmentSetup,
Recorder,
delay,
isPlaybackMode
Recorder
} from "@azure-tools/test-recorder";
import * as assert from "assert";
import { ClientSecretCredential } from "@azure/identity";
import { FeatureClient } from "../src/featureClient";

const recorderEnvSetup: RecorderEnvironmentSetup = {
replaceableVariables: {
Expand All @@ -35,58 +31,18 @@ const recorderEnvSetup: RecorderEnvironmentSetup = {
queryParametersToSkip: []
};

export const testPollingOptions = {
updateIntervalInMs: isPlaybackMode() ? 0 : undefined,
};

describe("Features test", () => {
describe("My test", () => {
let recorder: Recorder;
let subscriptionId: string;
let client: FeatureClient;
let location: string;
let resourceGroup: string;

beforeEach(async function() {
recorder = record(this, recorderEnvSetup);
subscriptionId = env.SUBSCRIPTION_ID;
// This is an example of how the environment variables are used
const credential = new ClientSecretCredential(
env.AZURE_TENANT_ID,
env.AZURE_CLIENT_ID,
env.AZURE_CLIENT_SECRET
);
client = new FeatureClient(credential, subscriptionId);
location = "eastus";
resourceGroup = "myjstest";
});

afterEach(async function() {
await recorder.stop();
});

it("features listall test", async function() {
const arrayList = [];
for await (const item of client.features.listAll()) {
arrayList.push(item);
}
assert.notEqual(arrayList.length,0);
});

it("features list test", async function() {
const arrayList = [];
for await (const item of client.features.list("Microsoft.Compute")) {
arrayList.push(item);
}
assert.notEqual(arrayList.length,0);
});

it("features get test", async function() {
const arrayList = new Array();
for await (const item of client.features.list("Microsoft.Compute")) {
arrayList.push(item);
}
const featureName = arrayList[0].name.split("/")[1];
const feature = await client.features.get("Microsoft.Compute", featureName);
assert.equal(feature.name,"Microsoft.Compute/"+featureName);
it("sample test", async function() {
console.log("Hi, I'm a test!");
});
});
17 changes: 13 additions & 4 deletions sdk/features/arm-features/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es6", "dom"],
"lib": [
"es6",
"dom"
],
"declaration": true,
"outDir": "./dist-esm",
"importHelpers": true
},
"include": ["./src/**/*.ts", "./test/**/*.ts"],
"exclude": ["node_modules"]
}
"include": [
"./src/**/*.ts",
"./test/**/*.ts",
"./test/**/*.ts"
],
"exclude": [
"node_modules"
]
}
7 changes: 4 additions & 3 deletions sdk/features/ci.mgmt.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.

trigger:
branches:
include:
Expand All @@ -10,6 +10,7 @@ trigger:
include:
- sdk/features/ci.mgmt.yml
- sdk/features/arm-features/
- sdk/features/arm-features
pr:
branches:
include:
Expand All @@ -23,11 +24,11 @@ pr:
include:
- sdk/features/ci.mgmt.yml
- sdk/features/arm-features/

- sdk/features/arm-features
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
ServiceDirectory: features
Artifacts:
- name: azure-arm-features
safeName: azurearmfeatures
safeName: azurearmfeatures

0 comments on commit 30f8d1f

Please sign in to comment.