Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_@azure/arm-features] Adding changes resource type #7292

Closed
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
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
2 changes: 1 addition & 1 deletion sdk/features/arm-features/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Azure Feature Exposure Control (AFEC) provides a mechanism for the resource prov

[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/features/arm-features) |
[Package (NPM)](https://www.npmjs.com/package/@azure/arm-features) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-features) |
[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-features?view=azure-node-preview) |
[Samples](https://github.com/Azure-Samples/azure-samples-js-management)

## Getting started
Expand Down
6 changes: 3 additions & 3 deletions sdk/features/arm-features/_meta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"commit": "a42f1b58607091c4f255ead152a8ef323fa0b280",
"commit": "339e30a693fabfa610ed69d387b095327167ec68",
"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/typescript@6.0.0-alpha.16.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=/home/vsts/work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/resources/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.16.20220105.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"use": "@autorest/typescript@6.0.0-alpha.16.20211130.1"
"use": "@autorest/typescript@6.0.0-alpha.16.20220105.1"
}
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"
}
}
}
}
}
4 changes: 2 additions & 2 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": "1.0.0-beta.1",
"engines": {
"node": ">=12.0.0"
},
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/1.0.0-beta.1`;
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!");
});
});
16 changes: 12 additions & 4 deletions sdk/features/arm-features/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,19 @@
"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"
],
"exclude": [
"node_modules"
]
}