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

Sample generation for MPG for cliassical client #2770

Merged
merged 110 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 107 commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
4a2ecc5
Upgrade to the latest tcgc
MaryGao Jul 29, 2024
03abd99
Update the fixes
MaryGao Jul 29, 2024
abbad79
Init sample generation
MaryGao Jul 29, 2024
e9ed632
Fix testing issues
MaryGao Jul 29, 2024
61d7964
Init sample gen
MaryGao Jul 29, 2024
5a2a237
Init sample gen
MaryGao Jul 29, 2024
71e8cd9
Upgrade tcgc to v44.3
v-jiaodi Jul 30, 2024
151258d
Merge branch 'main' into upgrade-to-july-tcgc-breakings
MaryGao Jul 30, 2024
66136b6
Merge remote-tracking branch 'origin/upgrade-to-july-tcgc-breakings' …
MaryGao Jul 30, 2024
fdece2e
Generate the first sample gen
MaryGao Jul 30, 2024
6fc0f29
Update the dependencies
MaryGao Jul 30, 2024
9bf7986
Merge branch 'main' into sample-experienmental
MaryGao Aug 6, 2024
2173981
Merge remote-tracking branch 'origin/main' into sample-experienmental
MaryGao Aug 7, 2024
0a37eb0
Merge remote-tracking branch 'origin/main' into sample-experienmental
MaryGao Aug 12, 2024
7d2ad50
Update the samples
MaryGao Aug 12, 2024
6897a9e
Update the sample gen for network anayltisc
MaryGao Aug 12, 2024
c0f2514
Build samples with multiple examples for one operations
MaryGao Aug 12, 2024
af3ed09
Merge remote-tracking branch 'origin/main' into sample-experienmental
MaryGao Aug 12, 2024
144ff67
Merge remote-tracking branch 'origin/main' into sample-experienmental
MaryGao Aug 13, 2024
ce16403
Update the samples
MaryGao Aug 13, 2024
a8d73ca
Update the comments in sample gen
MaryGao Aug 13, 2024
10267e1
Generate models from TCGC and use binder
joheredi Aug 15, 2024
2755e2f
Merge remote-tracking branch 'origin/main' into sample-experienmental
MaryGao Aug 18, 2024
4300767
Fix subscription id issue
MaryGao Aug 18, 2024
345016e
update the example summary
MaryGao Aug 18, 2024
842a3f4
Update the paging operations
MaryGao Aug 18, 2024
35b42a3
Add import for default credential
MaryGao Aug 18, 2024
7e399b1
Update the package name dependencies
MaryGao Aug 18, 2024
5ba88ff
update the package.json file
MaryGao Aug 18, 2024
a12885a
Update the property name
MaryGao Aug 18, 2024
1d0e542
generic serializers
joheredi Aug 19, 2024
bf1235b
Merge remote-tracking branch 'joheredi/binder-models-tcgc' into sampl…
MaryGao Aug 20, 2024
10560b3
Update the sample gen based on binder pr
MaryGao Aug 20, 2024
87731f1
Generate samples for hierachy client
MaryGao Aug 20, 2024
cd67ee9
Handle property renaming
MaryGao Aug 20, 2024
efea27b
update uts
MaryGao Aug 21, 2024
967696f
add example client test case
v-jiaodi Aug 22, 2024
f0bb990
Merge branch 'sample-experienmental' of https://github.com/MaryGao/au…
v-jiaodi Aug 22, 2024
8e1438f
update the samples
MaryGao Aug 22, 2024
03cb348
Merge remote-tracking branch 'mary/sample-experienmental' into sample…
MaryGao Aug 22, 2024
589fb28
update the sample generations
MaryGao Aug 22, 2024
c1ccd7e
update the sample cases
MaryGao Aug 22, 2024
6854140
update the sample cases
MaryGao Aug 22, 2024
a197772
update the test cases
MaryGao Aug 22, 2024
375f5d5
update the test cases
MaryGao Aug 22, 2024
3dc7147
update md files
MaryGao Aug 22, 2024
ccbaf5b
Merge remote-tracking branch 'origin/main' into sample-experienmental
MaryGao Aug 25, 2024
b2a2b6b
update to latest main
MaryGao Aug 25, 2024
2a17413
update to latest main
MaryGao Aug 25, 2024
0e9a0b4
update to latest main
MaryGao Aug 25, 2024
d90f637
update to the latest main
MaryGao Aug 25, 2024
b6da924
update to the latest main
MaryGao Aug 25, 2024
ecc1531
update to the latest main
MaryGao Aug 25, 2024
878e1f9
Update the samples with cases for operation level parameters
MaryGao Aug 25, 2024
343bf89
Update the hierarchyClientOperations
MaryGao Aug 25, 2024
cdc2bba
Update the hierachyClientOperations cases
MaryGao Aug 26, 2024
0e83e7c
update the samples
MaryGao Aug 26, 2024
aa9f203
Update the test cases and refactor code a little
MaryGao Aug 26, 2024
deb464b
Remove useless samples in smoke test
MaryGao Aug 26, 2024
6ebe76e
Update the samples and filter out constant values
MaryGao Aug 26, 2024
c4e5e70
Refactor the code a little
MaryGao Aug 26, 2024
89e75d3
Refactor the code a little
MaryGao Aug 26, 2024
be041bc
Merge branch 'sample-experienmental' into sample-gen-ready-branch
MaryGao Aug 26, 2024
00f2b83
Squash the commit hashes for sample gen
MaryGao Aug 26, 2024
96f93ee
smoke test and remove example client rlc
v-jiaodi Aug 26, 2024
855be9b
Merge branch 'sample-gen-ready-branch' of https://github.com/MaryGao/…
v-jiaodi Aug 26, 2024
d65c85b
remove example client rlc
v-jiaodi Aug 26, 2024
f1c2c5b
update tspconfig
v-jiaodi Aug 27, 2024
affb85a
Merge branch 'main' into sample-gen-ready-branch
MaryGao Aug 27, 2024
9e7acfb
Merge branch 'sample-gen-ready-branch' of https://github.com/MaryGao/…
v-jiaodi Aug 27, 2024
7573a7d
update tspconfig
v-jiaodi Aug 27, 2024
81ad5bb
Merge pull request #37 from v-jiaodi/update-tspconfig
MaryGao Aug 27, 2024
deeecfc
Fix the spread issues
MaryGao Aug 27, 2024
f52d231
Merge branch 'sample-gen-ready-branch' of https://github.com/marygao/…
MaryGao Aug 27, 2024
62cecad
Update the optional body cases
MaryGao Aug 27, 2024
e59c05c
Revert changes
MaryGao Aug 27, 2024
8edd48e
Rename methods
MaryGao Aug 27, 2024
206065d
Refactor a little the example code
MaryGao Aug 27, 2024
0c110b5
Update the enablement for arm
MaryGao Aug 27, 2024
be8e757
Update the default logic
MaryGao Aug 27, 2024
5f967d3
Fix build issues
MaryGao Aug 27, 2024
6a8cc24
Update the sample with multipleClient
MaryGao Aug 27, 2024
5041c49
Update the name
MaryGao Aug 27, 2024
1ec7457
Merge branch 'sample-gen-ready-branch' of https://github.com/MaryGao/…
v-jiaodi Aug 28, 2024
d307022
Merge branch 'main' of https://github.com/Azure/autorest.typescript i…
v-jiaodi Aug 29, 2024
d6ac403
update
v-jiaodi Aug 30, 2024
2de32ec
Merge pull request #42 from v-jiaodi/update-to-main
MaryGao Aug 30, 2024
d490174
Merge branch 'main' of https://github.com/Azure/autorest.typescript i…
v-jiaodi Sep 2, 2024
c7e6437
update
v-jiaodi Sep 2, 2024
9bb0566
Merge pull request #43 from v-jiaodi/update-to-main
MaryGao Sep 3, 2024
310f453
Refactor with client and method parameters
MaryGao Sep 3, 2024
eaf7545
Update the samples and skip console void result
MaryGao Sep 3, 2024
0bfe1af
Update the required body cases
MaryGao Sep 3, 2024
044787c
Merge branch 'sample-gen-ready-branch' of https://github.com/MaryGao/…
v-jiaodi Sep 3, 2024
efe501a
fix ci
v-jiaodi Sep 3, 2024
61da2ca
update the deduplicateProperties
MaryGao Sep 5, 2024
99d7154
Merge branch 'sample-gen-ready-branch' of https://github.com/marygao/…
MaryGao Sep 5, 2024
0b6575d
Merge remote-tracking branch 'origin/main' into sample-gen-ready-branch
MaryGao Sep 9, 2024
9b44440
Resolve conflicts
MaryGao Sep 9, 2024
99d78b3
Update packages/autorest.typescript/src/generators/modelsGenerator.ts
MaryGao Sep 9, 2024
ae61bd4
Resolve comments
MaryGao Sep 10, 2024
72af658
Update date and time cases
MaryGao Sep 10, 2024
7213fb4
Update the sample with sperated file and json pair
MaryGao Sep 10, 2024
e276359
Updated cases for hierachy and operation groups
MaryGao Sep 10, 2024
3b10e58
Just renamings
MaryGao Sep 10, 2024
adf158a
Merge to main
MaryGao Sep 10, 2024
0933004
Merge remote-tracking branch 'origin/main' into sample-gen-ready-branch
MaryGao Sep 10, 2024
a8cf417
Update the test cases
MaryGao Sep 11, 2024
9b185cb
update the descriptions
MaryGao Sep 13, 2024
956fe2c
Skip optional body test cases
MaryGao Sep 18, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { NetworkAnalyticsClient } from "@azure/arm-networkanalytics";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to assign role to the data product.
*
* @summary assign role to the data product.
* x-ms-original-file: 2023-11-15/DataProducts_AddUserRole_MaximumSet_Gen.json
MaryGao marked this conversation as resolved.
Show resolved Hide resolved
*/
async function dataProductsAddUserRoleMaximumSetGen() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-00000000000";
const client = new NetworkAnalyticsClient(credential, subscriptionId);
const result = await client.dataProducts.addUserRole(
"aoiresourceGroupName",
"dataproduct01",
{
roleId: "00000000-0000-0000-0000-00000000000",
principalId: "00000000-0000-0000-0000-00000000000",
userName: "UserName",
dataTypeScope: ["scope"],
principalType: "User",
role: "Reader",
},
);
console.log(result);
}

async function main() {
dataProductsAddUserRoleMaximumSetGen();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
MaryGao marked this conversation as resolved.
Show resolved Hide resolved

import { NetworkAnalyticsClient } from "@azure/arm-networkanalytics";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to create data product resource.
*
* @summary create data product resource.
* x-ms-original-file: 2023-11-15/DataProducts_Create_MaximumSet_Gen.json
*/
async function dataProductsCreateMaximumSetGen() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-00000000000";
const client = new NetworkAnalyticsClient(credential, subscriptionId);
const result = await client.dataProducts.create(
"aoiresourceGroupName",
"dataproduct01",
{
properties: {
provisioningState: "Succeeded",
MaryGao marked this conversation as resolved.
Show resolved Hide resolved
publisher: "Microsoft",
product: "MCC",
majorVersion: "1.0.0",
owners: ["[email protected]"],
redundancy: "Disabled",
purviewAccount: "testpurview",
purviewCollection: "134567890",
privateLinksEnabled: "Disabled",
publicNetworkAccess: "Enabled",
customerManagedKeyEncryptionEnabled: "Enabled",
customerEncryptionKey: {
keyVaultUri: "https://KeyVault.vault.azure.net",
keyName: "keyName",
keyVersion: "keyVersion",
},
networkacls: {
virtualNetworkRule: [
{
id: "/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/Microsoft.Network/virtualNetworks/virtualNetworkName/subnets/subnetName",
action: "Allow",
state: "",
},
],
ipRules: [{ value: "1.1.1.1", action: "Allow" }],
allowedQueryIpRangeList: ["1.1.1.1"],
defaultAction: "Allow",
},
managedResourceGroupConfiguration: {
name: "managedResourceGroupName",
location: "eastus",
},
currentMinorVersion: "1.0.1",
consumptionEndpoints: {},
},
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1":
{},
},
},
tags: { userSpecifiedKeyName: "userSpecifiedKeyValue" },
location: "eastus",
},
);
console.log(result);
}

async function main() {
dataProductsCreateMaximumSetGen();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { NetworkAnalyticsClient } from "@azure/arm-networkanalytics";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to delete data product resource.
*
* @summary delete data product resource.
* x-ms-original-file: 2023-11-15/DataProducts_Delete_MaximumSet_Gen.json
*/
async function dataProductsDeleteMaximumSetGen() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-00000000000";
const client = new NetworkAnalyticsClient(credential, subscriptionId);
await client.dataProducts.delete("aoiresourceGroupName", "dataproduct01");
}

async function main() {
dataProductsDeleteMaximumSetGen();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { NetworkAnalyticsClient } from "@azure/arm-networkanalytics";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to generate sas token for storage account.
*
* @summary generate sas token for storage account.
* x-ms-original-file: 2023-11-15/DataProducts_GenerateStorageAccountSasToken_MaximumSet_Gen.json
*/
async function dataProductsGenerateStorageAccountSasTokenMaximumSetGen() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-00000000000";
const client = new NetworkAnalyticsClient(credential, subscriptionId);
const result = await client.dataProducts.generateStorageAccountSasToken(
"aoiresourceGroupName",
"dataproduct01",
{
startTimeStamp: new Date("2023-08-24T05:34:58.151Z"),
MaryGao marked this conversation as resolved.
Show resolved Hide resolved
expiryTimeStamp: new Date("2023-08-24T05:34:58.151Z"),
ipAddress: "1.1.1.1",
},
);
console.log(result);
}

async function main() {
dataProductsGenerateStorageAccountSasTokenMaximumSetGen();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { NetworkAnalyticsClient } from "@azure/arm-networkanalytics";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to list data products by resource group.
*
* @summary list data products by resource group.
* x-ms-original-file: 2023-11-15/DataProducts_ListByResourceGroup_MinimumSet_Gen.json
*/
async function dataProductsListByResourceGroupMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-00000000000";
const client = new NetworkAnalyticsClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.dataProducts.listByResourceGroup(
"aoiresourceGroupName",
)) {
resArray.push(item);
}

console.log(resArray);
}

async function main() {
dataProductsListByResourceGroupMaximumSetGenGeneratedByMinimumSetRuleMinimumSetGen();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { NetworkAnalyticsClient } from "@azure/arm-networkanalytics";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to initiate key rotation on Data Product.
*
* @summary initiate key rotation on Data Product.
* x-ms-original-file: 2023-11-15/DataProducts_RotateKey_MaximumSet_Gen.json
*/
async function dataProductsRotateKeyMaximumSetGen() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-00000000000";
const client = new NetworkAnalyticsClient(credential, subscriptionId);
await client.dataProducts.rotateKey("aoiresourceGroupName", "dataproduct01", {
keyVaultUrl: "https://myKeyVault.vault.azure.net",
});
}

async function main() {
dataProductsRotateKeyMaximumSetGen();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { NetworkAnalyticsClient } from "@azure/arm-networkanalytics";
import { DefaultAzureCredential } from "@azure/identity";

/**
* This sample demonstrates how to update data product resource.
*
* @summary update data product resource.
* x-ms-original-file: 2023-11-15/DataProducts_Update_MaximumSet_Gen.json
*/
async function dataProductsUpdateMaximumSetGen() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-00000000000";
const client = new NetworkAnalyticsClient(credential, subscriptionId);
const result = await client.dataProducts.update(
"aoiresourceGroupName",
"dataproduct01",
{
identity: {
type: "UserAssigned",
userAssignedIdentities: {
"/subscriptions/subid/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1":
{},
},
},
tags: { userSpecifiedKeyName: "userSpecifiedKeyValue" },
properties: {
owners: ["[email protected]", "[email protected]"],
purviewAccount: "testpurview",
purviewCollection: "134567890",
privateLinksEnabled: "Disabled",
currentMinorVersion: "1.0.1",
},
},
);
console.log(result);
}

async function main() {
dataProductsUpdateMaximumSetGen();
}

main().catch(console.error);
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"forceConsistentCasingInFileNames": true,
"moduleResolution": "NodeNext",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
"esModuleInterop": true,
"paths": { "@azure/arm-networkanalytics": ["./src/index"] }
},
"include": ["./src/**/*.ts", "./test/**/*.ts"]
"include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"]
MaryGao marked this conversation as resolved.
Show resolved Hide resolved
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"title": "DataProducts_AddUserRole_MaximumSet_Gen",
"operationId": "DataProducts_AddUserRole",
"parameters": {
"api-version": "2023-11-15",
"subscriptionId": "00000000-0000-0000-0000-00000000000",
"resourceGroupName": "aoiresourceGroupName",
"dataProductName": "dataproduct01",
"body": {
"roleId": "00000000-0000-0000-0000-00000000000",
"principalId": "00000000-0000-0000-0000-00000000000",
"userName": "UserName",
"dataTypeScope": [
"scope"
],
"principalType": "User",
"role": "Reader"
}
},
"responses": {
"200": {
"body": {
"roleId": "00000000-0000-0000-0000-00000000000",
"principalId": "00000000-0000-0000-0000-00000000000",
"userName": "UserName",
"dataTypeScope": [
"scope"
],
"principalType": "User",
"role": "Reader",
"roleAssignmentId": "00000000-0000-0000-0000-00000000000"
}
}
}
}
Loading
Loading