diff --git a/sdk/billingbenefits/arm-billingbenefits/CHANGELOG.md b/sdk/billingbenefits/arm-billingbenefits/CHANGELOG.md deleted file mode 100644 index 2eadaa2a47da..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Release History - -## 1.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0 (2022-12-12) - -The package of @azure/arm-billingbenefits is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/billingbenefits/arm-billingbenefits/LICENSE b/sdk/billingbenefits/arm-billingbenefits/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/billingbenefits/arm-billingbenefits/LICENSE +++ b/sdk/billingbenefits/arm-billingbenefits/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 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 diff --git a/sdk/billingbenefits/arm-billingbenefits/_meta.json b/sdk/billingbenefits/arm-billingbenefits/_meta.json index 79b070d84217..57c942ea6729 100644 --- a/sdk/billingbenefits/arm-billingbenefits/_meta.json +++ b/sdk/billingbenefits/arm-billingbenefits/_meta.json @@ -1,8 +1,8 @@ { - "commit": "9b3aa35e75751e751070a7af1f96518cb8820e44", + "commit": "e6ed9e5774705dac69ae30c592c08b1a82aaa511", "readme": "specification/billingbenefits/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\billingbenefits\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.4 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/billingbenefits/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.5", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", - "use": "@autorest/typescript@6.0.0-rc.4" + "release_tool": "@azure-tools/js-sdk-release-tools@2.6.1", + "use": "@autorest/typescript@6.0.0-rc.5" } \ No newline at end of file diff --git a/sdk/billingbenefits/arm-billingbenefits/package.json b/sdk/billingbenefits/arm-billingbenefits/package.json index 4e2ec47dea28..459649b90498 100644 --- a/sdk/billingbenefits/arm-billingbenefits/package.json +++ b/sdk/billingbenefits/arm-billingbenefits/package.json @@ -110,13 +110,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-billingbenefits?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/billingbenefits/arm-billingbenefits/recordings/node/my_test/recording_sample_test.json b/sdk/billingbenefits/arm-billingbenefits/recordings/node/my_test/recording_sample_test.json deleted file mode 100644 index f721723386d8..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/recordings/node/my_test/recording_sample_test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Entries": [], - "Variables": {} -} diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/operationsListSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/operationsListSample.ts deleted file mode 100644 index bdfd47b987c3..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List all the operations. - * - * @summary List all the operations. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet.json - */ -async function operationsGet() { - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -operationsGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/reservationOrderAliasCreateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/reservationOrderAliasCreateSample.ts deleted file mode 100644 index e31a37d0df4a..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/reservationOrderAliasCreateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ReservationOrderAliasRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a reservation order alias. - * - * @summary Create a reservation order alias. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasCreate.json - */ -async function reservationOrderAliasCreate() { - const reservationOrderAliasName = "reservationOrderAlias123"; - const body: ReservationOrderAliasRequest = { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - displayName: "ReservationOrder_2022-06-02", - location: "eastus", - quantity: 5, - renew: true, - reservedResourceProperties: { instanceFlexibility: "On" }, - reservedResourceType: "VirtualMachines", - sku: { name: "Standard_M64s_v2" }, - term: "P1Y" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.reservationOrderAlias.beginCreateAndWait( - reservationOrderAliasName, - body - ); - console.log(result); -} - -reservationOrderAliasCreate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/reservationOrderAliasGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/reservationOrderAliasGetSample.ts deleted file mode 100644 index 6e4892c8198b..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/reservationOrderAliasGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a reservation order alias. - * - * @summary Get a reservation order alias. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasGet.json - */ -async function reservationOrderAliasGet() { - const reservationOrderAliasName = "reservationOrderAlias123"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.reservationOrderAlias.get( - reservationOrderAliasName - ); - console.log(result); -} - -reservationOrderAliasGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanGetSample.ts deleted file mode 100644 index 5cafab0d01bf..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanGetSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanGetOptionalParams, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get savings plan. - * - * @summary Get savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemGet.json - */ -async function savingsPlanItemGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.get( - savingsPlanOrderId, - savingsPlanId - ); - console.log(result); -} - -savingsPlanItemGet().catch(console.error); - -/** - * This sample demonstrates how to Get savings plan. - * - * @summary Get savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemExpandedGet.json - */ -async function savingsPlanItemWithExpandedRenewPropertiesGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const expand = "renewProperties"; - const options: SavingsPlanGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.get( - savingsPlanOrderId, - savingsPlanId, - options - ); - console.log(result); -} - -savingsPlanItemWithExpandedRenewPropertiesGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanListAllSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanListAllSample.ts deleted file mode 100644 index e86c1aa46773..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanListAllSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanListAllOptionalParams, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List savings plans. - * - * @summary List savings plans. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansList.json - */ -async function savingsPlansList() { - const filter = "(properties%2farchived+eq+false)"; - const orderby = "properties/displayName asc"; - const skiptoken = 50; - const take = 1; - const options: SavingsPlanListAllOptionalParams = { - filter, - orderby, - skiptoken, - take - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlan.listAll(options)) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlansList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanListSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanListSample.ts deleted file mode 100644 index 7597b04e8309..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List savings plans in an order. - * - * @summary List savings plans in an order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansInOrderList.json - */ -async function savingsPlansInOrderList() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlan.list(savingsPlanOrderId)) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlansInOrderList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderAliasCreateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderAliasCreateSample.ts deleted file mode 100644 index 43414a45a9be..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderAliasCreateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanOrderAliasModel, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * - * @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json - */ -async function savingsPlanOrderAliasCreate() { - const savingsPlanOrderAliasName = "spAlias123"; - const body: SavingsPlanOrderAliasModel = { - appliedScopeProperties: {}, - appliedScopeType: "Shared", - billingPlan: "P1M", - billingScopeId: "/subscriptions/30000000-0000-0000-0000-000000000000", - commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, - displayName: "Compute_SavingsPlan_10-28-2022_16-38", - sku: { name: "Compute_Savings_Plan" }, - term: "P3Y" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.beginCreateAndWait( - savingsPlanOrderAliasName, - body - ); - console.log(result); -} - -savingsPlanOrderAliasCreate().catch(console.error); - -/** - * This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * - * @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json - */ -async function savingsPlanOrderAliasCreateSingleScope() { - const savingsPlanOrderAliasName = "spAlias123"; - const body: SavingsPlanOrderAliasModel = { - appliedScopeProperties: { - subscriptionId: "/subscriptions/30000000-0000-0000-0000-000000000000" - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: - "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000", - commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, - displayName: "Compute_SavingsPlan_10-28-2022_16-38", - sku: { name: "Compute_Savings_Plan" }, - term: "P3Y" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.beginCreateAndWait( - savingsPlanOrderAliasName, - body - ); - console.log(result); -} - -savingsPlanOrderAliasCreateSingleScope().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderAliasGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderAliasGetSample.ts deleted file mode 100644 index ad181ec86529..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderAliasGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a savings plan. - * - * @summary Get a savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasGet.json - */ -async function savingsPlanOrderAliasGet() { - const savingsPlanOrderAliasName = "spAlias123"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.get( - savingsPlanOrderAliasName - ); - console.log(result); -} - -savingsPlanOrderAliasGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderElevateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderElevateSample.ts deleted file mode 100644 index d410fe4be87a..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderElevateSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Elevate as owner on savings plan order based on billing permissions. - * - * @summary Elevate as owner on savings plan order based on billing permissions. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json - */ -async function savingsPlanOrderElevate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.elevate(savingsPlanOrderId); - console.log(result); -} - -savingsPlanOrderElevate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderGetSample.ts deleted file mode 100644 index b0fd406d91b6..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderGetSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanOrderGetOptionalParams, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a savings plan order. - * - * @summary Get a savings plan order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderGet.json - */ -async function savingsPlanOrderGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.get(savingsPlanOrderId); - console.log(result); -} - -savingsPlanOrderGet().catch(console.error); - -/** - * This sample demonstrates how to Get a savings plan order. - * - * @summary Get a savings plan order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderExpandedGet.json - */ -async function savingsPlanOrderWithExpandedPaymentsGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const expand = "schedule"; - const options: SavingsPlanOrderGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.get(savingsPlanOrderId, options); - console.log(result); -} - -savingsPlanOrderWithExpandedPaymentsGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderListSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderListSample.ts deleted file mode 100644 index 0b313bffd69e..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanOrderListSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List all Savings plan orders. - * - * @summary List all Savings plan orders. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderList.json - */ -async function savingsPlanOrderList() { - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlanOrder.list()) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlanOrderList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanUpdateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanUpdateSample.ts deleted file mode 100644 index 6e8ab25f9cb0..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanUpdateSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanUpdateRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Update savings plan. - * - * @summary Update savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanUpdate.json - */ -async function savingsPlanUpdate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const body: SavingsPlanUpdateRequest = { - properties: { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - displayName: "TestDisplayName", - renew: true, - renewProperties: { - purchaseProperties: { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 15.23, currencyCode: "USD", grain: "Hourly" }, - displayName: "TestDisplayName_renewed", - renew: false, - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y" - } - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.update( - savingsPlanOrderId, - savingsPlanId, - body - ); - console.log(result); -} - -savingsPlanUpdate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanValidateUpdateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanValidateUpdateSample.ts deleted file mode 100644 index 319781fb5eea..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/savingsPlanValidateUpdateSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanUpdateValidateRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Validate savings plan patch. - * - * @summary Validate savings plan patch. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidateUpdate.json - */ -async function savingsPlanValidateUpdate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const body: SavingsPlanUpdateValidateRequest = { - benefits: [ - { - appliedScopeProperties: { - managementGroupId: - "/providers/Microsoft.Management/managementGroups/30000000-0000-0000-0000-000000000100", - tenantId: "30000000-0000-0000-0000-000000000100" - }, - appliedScopeType: "ManagementGroup" - }, - { - appliedScopeProperties: { - managementGroupId: - "/providers/Microsoft.Management/managementGroups/MockMG", - tenantId: "30000000-0000-0000-0000-000000000100" - }, - appliedScopeType: "ManagementGroup" - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.validateUpdate( - savingsPlanOrderId, - savingsPlanId, - body - ); - console.log(result); -} - -savingsPlanValidateUpdate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples-dev/validatePurchaseSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples-dev/validatePurchaseSample.ts deleted file mode 100644 index 3d39e0cd0840..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples-dev/validatePurchaseSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanPurchaseValidateRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Validate savings plan purchase. - * - * @summary Validate savings plan purchase. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidatePurchase.json - */ -async function savingsPlanValidatePurchase() { - const body: SavingsPlanPurchaseValidateRequest = { - benefits: [ - { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 15.23, currencyCode: "USD", grain: "Hourly" }, - displayName: "ComputeSavingsPlan_2021-07-01", - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y" - }, - { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/RG" - }, - appliedScopeType: "Single", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 20, currencyCode: "USD", grain: "Hourly" }, - displayName: "ComputeSavingsPlan_2021-07-01", - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y" - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.validatePurchase(body); - console.log(result); -} - -savingsPlanValidatePurchase().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/README.md b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/README.md deleted file mode 100644 index e41d2bd00640..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.js][operationslistsample] | List all the operations. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet.json | -| [reservationOrderAliasCreateSample.js][reservationorderaliascreatesample] | Create a reservation order alias. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasCreate.json | -| [reservationOrderAliasGetSample.js][reservationorderaliasgetsample] | Get a reservation order alias. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasGet.json | -| [savingsPlanGetSample.js][savingsplangetsample] | Get savings plan. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemGet.json | -| [savingsPlanListAllSample.js][savingsplanlistallsample] | List savings plans. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansList.json | -| [savingsPlanListSample.js][savingsplanlistsample] | List savings plans in an order. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansInOrderList.json | -| [savingsPlanOrderAliasCreateSample.js][savingsplanorderaliascreatesample] | Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json | -| [savingsPlanOrderAliasGetSample.js][savingsplanorderaliasgetsample] | Get a savings plan. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasGet.json | -| [savingsPlanOrderElevateSample.js][savingsplanorderelevatesample] | Elevate as owner on savings plan order based on billing permissions. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json | -| [savingsPlanOrderGetSample.js][savingsplanordergetsample] | Get a savings plan order. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderGet.json | -| [savingsPlanOrderListSample.js][savingsplanorderlistsample] | List all Savings plan orders. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderList.json | -| [savingsPlanUpdateSample.js][savingsplanupdatesample] | Update savings plan. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanUpdate.json | -| [savingsPlanValidateUpdateSample.js][savingsplanvalidateupdatesample] | Validate savings plan patch. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidateUpdate.json | -| [validatePurchaseSample.js][validatepurchasesample] | Validate savings plan purchase. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidatePurchase.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node operationsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/operationsListSample.js -[reservationorderaliascreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasCreateSample.js -[reservationorderaliasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasGetSample.js -[savingsplangetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanGetSample.js -[savingsplanlistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListAllSample.js -[savingsplanlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListSample.js -[savingsplanorderaliascreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasCreateSample.js -[savingsplanorderaliasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasGetSample.js -[savingsplanorderelevatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderElevateSample.js -[savingsplanordergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderGetSample.js -[savingsplanorderlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderListSample.js -[savingsplanupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanUpdateSample.js -[savingsplanvalidateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanValidateUpdateSample.js -[validatepurchasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/validatePurchaseSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-billingbenefits?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billingbenefits/arm-billingbenefits/README.md diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/operationsListSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/operationsListSample.js deleted file mode 100644 index 58d55f85d91d..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/operationsListSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List all the operations. - * - * @summary List all the operations. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet.json - */ -async function operationsGet() { - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -operationsGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/package.json b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/package.json deleted file mode 100644 index 124a0d7f1d72..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-billingbenefits-js", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript", - "engines": { - "node": ">=14.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/billingbenefits/arm-billingbenefits" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billingbenefits/arm-billingbenefits", - "dependencies": { - "@azure/arm-billingbenefits": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasCreateSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasCreateSample.js deleted file mode 100644 index 1f052a641dbf..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasCreateSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create a reservation order alias. - * - * @summary Create a reservation order alias. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasCreate.json - */ -async function reservationOrderAliasCreate() { - const reservationOrderAliasName = "reservationOrderAlias123"; - const body = { - appliedScopeProperties: { - resourceGroupId: "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg", - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - displayName: "ReservationOrder_2022-06-02", - location: "eastus", - quantity: 5, - renew: true, - reservedResourceProperties: { instanceFlexibility: "On" }, - reservedResourceType: "VirtualMachines", - sku: { name: "Standard_M64s_v2" }, - term: "P1Y", - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.reservationOrderAlias.beginCreateAndWait( - reservationOrderAliasName, - body - ); - console.log(result); -} - -reservationOrderAliasCreate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasGetSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasGetSample.js deleted file mode 100644 index 14a344d3743d..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/reservationOrderAliasGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a reservation order alias. - * - * @summary Get a reservation order alias. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasGet.json - */ -async function reservationOrderAliasGet() { - const reservationOrderAliasName = "reservationOrderAlias123"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.reservationOrderAlias.get(reservationOrderAliasName); - console.log(result); -} - -reservationOrderAliasGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/sample.env b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanGetSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanGetSample.js deleted file mode 100644 index fbcdd2d2dcb3..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanGetSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get savings plan. - * - * @summary Get savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemGet.json - */ -async function savingsPlanItemGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.get(savingsPlanOrderId, savingsPlanId); - console.log(result); -} - -savingsPlanItemGet().catch(console.error); - -/** - * This sample demonstrates how to Get savings plan. - * - * @summary Get savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemExpandedGet.json - */ -async function savingsPlanItemWithExpandedRenewPropertiesGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const expand = "renewProperties"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.get(savingsPlanOrderId, savingsPlanId, options); - console.log(result); -} - -savingsPlanItemWithExpandedRenewPropertiesGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListAllSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListAllSample.js deleted file mode 100644 index ec2b9eb8a1ad..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListAllSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List savings plans. - * - * @summary List savings plans. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansList.json - */ -async function savingsPlansList() { - const filter = "(properties%2farchived+eq+false)"; - const orderby = "properties/displayName asc"; - const skiptoken = 50; - const take = 1; - const options = { - filter, - orderby, - skiptoken, - take, - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlan.listAll(options)) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlansList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListSample.js deleted file mode 100644 index 205978e53bd0..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanListSample.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List savings plans in an order. - * - * @summary List savings plans in an order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansInOrderList.json - */ -async function savingsPlansInOrderList() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlan.list(savingsPlanOrderId)) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlansInOrderList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasCreateSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasCreateSample.js deleted file mode 100644 index 1d9c5662fb3f..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasCreateSample.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * - * @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json - */ -async function savingsPlanOrderAliasCreate() { - const savingsPlanOrderAliasName = "spAlias123"; - const body = { - appliedScopeProperties: {}, - appliedScopeType: "Shared", - billingPlan: "P1M", - billingScopeId: "/subscriptions/30000000-0000-0000-0000-000000000000", - commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, - displayName: "Compute_SavingsPlan_10-28-2022_16-38", - sku: { name: "Compute_Savings_Plan" }, - term: "P3Y", - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.beginCreateAndWait( - savingsPlanOrderAliasName, - body - ); - console.log(result); -} - -savingsPlanOrderAliasCreate().catch(console.error); - -/** - * This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * - * @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json - */ -async function savingsPlanOrderAliasCreateSingleScope() { - const savingsPlanOrderAliasName = "spAlias123"; - const body = { - appliedScopeProperties: { - subscriptionId: "/subscriptions/30000000-0000-0000-0000-000000000000", - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: - "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000", - commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, - displayName: "Compute_SavingsPlan_10-28-2022_16-38", - sku: { name: "Compute_Savings_Plan" }, - term: "P3Y", - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.beginCreateAndWait( - savingsPlanOrderAliasName, - body - ); - console.log(result); -} - -savingsPlanOrderAliasCreateSingleScope().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasGetSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasGetSample.js deleted file mode 100644 index 9086758cd71c..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderAliasGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a savings plan. - * - * @summary Get a savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasGet.json - */ -async function savingsPlanOrderAliasGet() { - const savingsPlanOrderAliasName = "spAlias123"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.get(savingsPlanOrderAliasName); - console.log(result); -} - -savingsPlanOrderAliasGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderElevateSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderElevateSample.js deleted file mode 100644 index e2ca2aa6c775..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderElevateSample.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Elevate as owner on savings plan order based on billing permissions. - * - * @summary Elevate as owner on savings plan order based on billing permissions. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json - */ -async function savingsPlanOrderElevate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.elevate(savingsPlanOrderId); - console.log(result); -} - -savingsPlanOrderElevate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderGetSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderGetSample.js deleted file mode 100644 index aa8ed3ea6c28..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderGetSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Get a savings plan order. - * - * @summary Get a savings plan order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderGet.json - */ -async function savingsPlanOrderGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.get(savingsPlanOrderId); - console.log(result); -} - -savingsPlanOrderGet().catch(console.error); - -/** - * This sample demonstrates how to Get a savings plan order. - * - * @summary Get a savings plan order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderExpandedGet.json - */ -async function savingsPlanOrderWithExpandedPaymentsGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const expand = "schedule"; - const options = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.get(savingsPlanOrderId, options); - console.log(result); -} - -savingsPlanOrderWithExpandedPaymentsGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderListSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderListSample.js deleted file mode 100644 index 631ad9ee919c..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanOrderListSample.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to List all Savings plan orders. - * - * @summary List all Savings plan orders. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderList.json - */ -async function savingsPlanOrderList() { - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlanOrder.list()) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlanOrderList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanUpdateSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanUpdateSample.js deleted file mode 100644 index f4e88b175aa0..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanUpdateSample.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Update savings plan. - * - * @summary Update savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanUpdate.json - */ -async function savingsPlanUpdate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const body = { - properties: { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg", - }, - appliedScopeType: "Single", - displayName: "TestDisplayName", - renew: true, - renewProperties: { - purchaseProperties: { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg", - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 15.23, currencyCode: "USD", grain: "Hourly" }, - displayName: "TestDisplayName_renewed", - renew: false, - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y", - }, - }, - }, - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.update(savingsPlanOrderId, savingsPlanId, body); - console.log(result); -} - -savingsPlanUpdate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanValidateUpdateSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanValidateUpdateSample.js deleted file mode 100644 index ddbb8fb4f722..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/savingsPlanValidateUpdateSample.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Validate savings plan patch. - * - * @summary Validate savings plan patch. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidateUpdate.json - */ -async function savingsPlanValidateUpdate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const body = { - benefits: [ - { - appliedScopeProperties: { - managementGroupId: - "/providers/Microsoft.Management/managementGroups/30000000-0000-0000-0000-000000000100", - tenantId: "30000000-0000-0000-0000-000000000100", - }, - appliedScopeType: "ManagementGroup", - }, - { - appliedScopeProperties: { - managementGroupId: "/providers/Microsoft.Management/managementGroups/MockMG", - tenantId: "30000000-0000-0000-0000-000000000100", - }, - appliedScopeType: "ManagementGroup", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.validateUpdate(savingsPlanOrderId, savingsPlanId, body); - console.log(result); -} - -savingsPlanValidateUpdate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/validatePurchaseSample.js b/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/validatePurchaseSample.js deleted file mode 100644 index 1db777963773..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/javascript/validatePurchaseSample.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { BillingBenefitsRP } = require("@azure/arm-billingbenefits"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to Validate savings plan purchase. - * - * @summary Validate savings plan purchase. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidatePurchase.json - */ -async function savingsPlanValidatePurchase() { - const body = { - benefits: [ - { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg", - }, - appliedScopeType: "Single", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 15.23, currencyCode: "USD", grain: "Hourly" }, - displayName: "ComputeSavingsPlan_2021-07-01", - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y", - }, - { - appliedScopeProperties: { - resourceGroupId: "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/RG", - }, - appliedScopeType: "Single", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 20, currencyCode: "USD", grain: "Hourly" }, - displayName: "ComputeSavingsPlan_2021-07-01", - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y", - }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.validatePurchase(body); - console.log(result); -} - -savingsPlanValidatePurchase().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/README.md b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/README.md deleted file mode 100644 index ab09762cff9e..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [operationsListSample.ts][operationslistsample] | List all the operations. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet.json | -| [reservationOrderAliasCreateSample.ts][reservationorderaliascreatesample] | Create a reservation order alias. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasCreate.json | -| [reservationOrderAliasGetSample.ts][reservationorderaliasgetsample] | Get a reservation order alias. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasGet.json | -| [savingsPlanGetSample.ts][savingsplangetsample] | Get savings plan. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemGet.json | -| [savingsPlanListAllSample.ts][savingsplanlistallsample] | List savings plans. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansList.json | -| [savingsPlanListSample.ts][savingsplanlistsample] | List savings plans in an order. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansInOrderList.json | -| [savingsPlanOrderAliasCreateSample.ts][savingsplanorderaliascreatesample] | Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json | -| [savingsPlanOrderAliasGetSample.ts][savingsplanorderaliasgetsample] | Get a savings plan. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasGet.json | -| [savingsPlanOrderElevateSample.ts][savingsplanorderelevatesample] | Elevate as owner on savings plan order based on billing permissions. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json | -| [savingsPlanOrderGetSample.ts][savingsplanordergetsample] | Get a savings plan order. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderGet.json | -| [savingsPlanOrderListSample.ts][savingsplanorderlistsample] | List all Savings plan orders. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderList.json | -| [savingsPlanUpdateSample.ts][savingsplanupdatesample] | Update savings plan. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanUpdate.json | -| [savingsPlanValidateUpdateSample.ts][savingsplanvalidateupdatesample] | Validate savings plan patch. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidateUpdate.json | -| [validatePurchaseSample.ts][validatepurchasesample] | Validate savings plan purchase. x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidatePurchase.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/operationsListSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env node dist/operationsListSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/operationsListSample.ts -[reservationorderaliascreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasCreateSample.ts -[reservationorderaliasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasGetSample.ts -[savingsplangetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanGetSample.ts -[savingsplanlistallsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListAllSample.ts -[savingsplanlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListSample.ts -[savingsplanorderaliascreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasCreateSample.ts -[savingsplanorderaliasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasGetSample.ts -[savingsplanorderelevatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderElevateSample.ts -[savingsplanordergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderGetSample.ts -[savingsplanorderlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderListSample.ts -[savingsplanupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanUpdateSample.ts -[savingsplanvalidateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanValidateUpdateSample.ts -[validatepurchasesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/validatePurchaseSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-billingbenefits?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billingbenefits/arm-billingbenefits/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/package.json b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/package.json deleted file mode 100644 index 47a68d9f545c..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-billingbenefits-ts", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript", - "engines": { - "node": ">=14.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/billingbenefits/arm-billingbenefits" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/billingbenefits/arm-billingbenefits", - "dependencies": { - "@azure/arm-billingbenefits": "latest", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^14.0.0", - "typescript": "~4.8.0", - "rimraf": "latest" - } -} diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/sample.env b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/operationsListSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/operationsListSample.ts deleted file mode 100644 index bdfd47b987c3..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List all the operations. - * - * @summary List all the operations. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/OperationsGet.json - */ -async function operationsGet() { - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -operationsGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasCreateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasCreateSample.ts deleted file mode 100644 index e31a37d0df4a..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasCreateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ReservationOrderAliasRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a reservation order alias. - * - * @summary Create a reservation order alias. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasCreate.json - */ -async function reservationOrderAliasCreate() { - const reservationOrderAliasName = "reservationOrderAlias123"; - const body: ReservationOrderAliasRequest = { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - displayName: "ReservationOrder_2022-06-02", - location: "eastus", - quantity: 5, - renew: true, - reservedResourceProperties: { instanceFlexibility: "On" }, - reservedResourceType: "VirtualMachines", - sku: { name: "Standard_M64s_v2" }, - term: "P1Y" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.reservationOrderAlias.beginCreateAndWait( - reservationOrderAliasName, - body - ); - console.log(result); -} - -reservationOrderAliasCreate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasGetSample.ts deleted file mode 100644 index 6e4892c8198b..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/reservationOrderAliasGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a reservation order alias. - * - * @summary Get a reservation order alias. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/ReservationOrderAliasGet.json - */ -async function reservationOrderAliasGet() { - const reservationOrderAliasName = "reservationOrderAlias123"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.reservationOrderAlias.get( - reservationOrderAliasName - ); - console.log(result); -} - -reservationOrderAliasGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanGetSample.ts deleted file mode 100644 index 5cafab0d01bf..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanGetSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanGetOptionalParams, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get savings plan. - * - * @summary Get savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemGet.json - */ -async function savingsPlanItemGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.get( - savingsPlanOrderId, - savingsPlanId - ); - console.log(result); -} - -savingsPlanItemGet().catch(console.error); - -/** - * This sample demonstrates how to Get savings plan. - * - * @summary Get savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanItemExpandedGet.json - */ -async function savingsPlanItemWithExpandedRenewPropertiesGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const expand = "renewProperties"; - const options: SavingsPlanGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.get( - savingsPlanOrderId, - savingsPlanId, - options - ); - console.log(result); -} - -savingsPlanItemWithExpandedRenewPropertiesGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListAllSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListAllSample.ts deleted file mode 100644 index e86c1aa46773..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListAllSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanListAllOptionalParams, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List savings plans. - * - * @summary List savings plans. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansList.json - */ -async function savingsPlansList() { - const filter = "(properties%2farchived+eq+false)"; - const orderby = "properties/displayName asc"; - const skiptoken = 50; - const take = 1; - const options: SavingsPlanListAllOptionalParams = { - filter, - orderby, - skiptoken, - take - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlan.listAll(options)) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlansList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListSample.ts deleted file mode 100644 index 7597b04e8309..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanListSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List savings plans in an order. - * - * @summary List savings plans in an order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlansInOrderList.json - */ -async function savingsPlansInOrderList() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlan.list(savingsPlanOrderId)) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlansInOrderList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasCreateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasCreateSample.ts deleted file mode 100644 index 43414a45a9be..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasCreateSample.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanOrderAliasModel, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * - * @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreate.json - */ -async function savingsPlanOrderAliasCreate() { - const savingsPlanOrderAliasName = "spAlias123"; - const body: SavingsPlanOrderAliasModel = { - appliedScopeProperties: {}, - appliedScopeType: "Shared", - billingPlan: "P1M", - billingScopeId: "/subscriptions/30000000-0000-0000-0000-000000000000", - commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, - displayName: "Compute_SavingsPlan_10-28-2022_16-38", - sku: { name: "Compute_Savings_Plan" }, - term: "P3Y" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.beginCreateAndWait( - savingsPlanOrderAliasName, - body - ); - console.log(result); -} - -savingsPlanOrderAliasCreate().catch(console.error); - -/** - * This sample demonstrates how to Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * - * @summary Create a savings plan. Learn more about permissions needed at https://go.microsoft.com/fwlink/?linkid=2215851 - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasCreateSingleScope.json - */ -async function savingsPlanOrderAliasCreateSingleScope() { - const savingsPlanOrderAliasName = "spAlias123"; - const body: SavingsPlanOrderAliasModel = { - appliedScopeProperties: { - subscriptionId: "/subscriptions/30000000-0000-0000-0000-000000000000" - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: - "/providers/Microsoft.Billing/billingAccounts/1234567/billingSubscriptions/30000000-0000-0000-0000-000000000000", - commitment: { amount: 0.001, currencyCode: "USD", grain: "Hourly" }, - displayName: "Compute_SavingsPlan_10-28-2022_16-38", - sku: { name: "Compute_Savings_Plan" }, - term: "P3Y" - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.beginCreateAndWait( - savingsPlanOrderAliasName, - body - ); - console.log(result); -} - -savingsPlanOrderAliasCreateSingleScope().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasGetSample.ts deleted file mode 100644 index ad181ec86529..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderAliasGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a savings plan. - * - * @summary Get a savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderAliasGet.json - */ -async function savingsPlanOrderAliasGet() { - const savingsPlanOrderAliasName = "spAlias123"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrderAlias.get( - savingsPlanOrderAliasName - ); - console.log(result); -} - -savingsPlanOrderAliasGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderElevateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderElevateSample.ts deleted file mode 100644 index d410fe4be87a..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderElevateSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Elevate as owner on savings plan order based on billing permissions. - * - * @summary Elevate as owner on savings plan order based on billing permissions. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderElevate.json - */ -async function savingsPlanOrderElevate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.elevate(savingsPlanOrderId); - console.log(result); -} - -savingsPlanOrderElevate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderGetSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderGetSample.ts deleted file mode 100644 index b0fd406d91b6..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderGetSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanOrderGetOptionalParams, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Get a savings plan order. - * - * @summary Get a savings plan order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderGet.json - */ -async function savingsPlanOrderGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.get(savingsPlanOrderId); - console.log(result); -} - -savingsPlanOrderGet().catch(console.error); - -/** - * This sample demonstrates how to Get a savings plan order. - * - * @summary Get a savings plan order. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderExpandedGet.json - */ -async function savingsPlanOrderWithExpandedPaymentsGet() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const expand = "schedule"; - const options: SavingsPlanOrderGetOptionalParams = { expand }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlanOrder.get(savingsPlanOrderId, options); - console.log(result); -} - -savingsPlanOrderWithExpandedPaymentsGet().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderListSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderListSample.ts deleted file mode 100644 index 0b313bffd69e..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanOrderListSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { BillingBenefitsRP } from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to List all Savings plan orders. - * - * @summary List all Savings plan orders. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanOrderList.json - */ -async function savingsPlanOrderList() { - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const resArray = new Array(); - for await (let item of client.savingsPlanOrder.list()) { - resArray.push(item); - } - console.log(resArray); -} - -savingsPlanOrderList().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanUpdateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanUpdateSample.ts deleted file mode 100644 index 6e8ab25f9cb0..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanUpdateSample.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanUpdateRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Update savings plan. - * - * @summary Update savings plan. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanUpdate.json - */ -async function savingsPlanUpdate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const body: SavingsPlanUpdateRequest = { - properties: { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - displayName: "TestDisplayName", - renew: true, - renewProperties: { - purchaseProperties: { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - billingPlan: "P1M", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 15.23, currencyCode: "USD", grain: "Hourly" }, - displayName: "TestDisplayName_renewed", - renew: false, - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y" - } - } - } - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.update( - savingsPlanOrderId, - savingsPlanId, - body - ); - console.log(result); -} - -savingsPlanUpdate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanValidateUpdateSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanValidateUpdateSample.ts deleted file mode 100644 index 319781fb5eea..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/savingsPlanValidateUpdateSample.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanUpdateValidateRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Validate savings plan patch. - * - * @summary Validate savings plan patch. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidateUpdate.json - */ -async function savingsPlanValidateUpdate() { - const savingsPlanOrderId = "20000000-0000-0000-0000-000000000000"; - const savingsPlanId = "30000000-0000-0000-0000-000000000000"; - const body: SavingsPlanUpdateValidateRequest = { - benefits: [ - { - appliedScopeProperties: { - managementGroupId: - "/providers/Microsoft.Management/managementGroups/30000000-0000-0000-0000-000000000100", - tenantId: "30000000-0000-0000-0000-000000000100" - }, - appliedScopeType: "ManagementGroup" - }, - { - appliedScopeProperties: { - managementGroupId: - "/providers/Microsoft.Management/managementGroups/MockMG", - tenantId: "30000000-0000-0000-0000-000000000100" - }, - appliedScopeType: "ManagementGroup" - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.savingsPlan.validateUpdate( - savingsPlanOrderId, - savingsPlanId, - body - ); - console.log(result); -} - -savingsPlanValidateUpdate().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/validatePurchaseSample.ts b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/validatePurchaseSample.ts deleted file mode 100644 index 3d39e0cd0840..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/src/validatePurchaseSample.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - SavingsPlanPurchaseValidateRequest, - BillingBenefitsRP -} from "@azure/arm-billingbenefits"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to Validate savings plan purchase. - * - * @summary Validate savings plan purchase. - * x-ms-original-file: specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/examples/SavingsPlanValidatePurchase.json - */ -async function savingsPlanValidatePurchase() { - const body: SavingsPlanPurchaseValidateRequest = { - benefits: [ - { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/testrg" - }, - appliedScopeType: "Single", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 15.23, currencyCode: "USD", grain: "Hourly" }, - displayName: "ComputeSavingsPlan_2021-07-01", - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y" - }, - { - appliedScopeProperties: { - resourceGroupId: - "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/RG" - }, - appliedScopeType: "Single", - billingScopeId: "/subscriptions/10000000-0000-0000-0000-000000000000", - commitment: { amount: 20, currencyCode: "USD", grain: "Hourly" }, - displayName: "ComputeSavingsPlan_2021-07-01", - sku: { name: "Compute_Savings_Plan" }, - term: "P1Y" - } - ] - }; - const credential = new DefaultAzureCredential(); - const client = new BillingBenefitsRP(credential); - const result = await client.validatePurchase(body); - console.log(result); -} - -savingsPlanValidatePurchase().catch(console.error); diff --git a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/tsconfig.json b/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/billingbenefits/arm-billingbenefits/samples/v1/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**.ts" - ] -} diff --git a/sdk/billingbenefits/arm-billingbenefits/tsconfig.json b/sdk/billingbenefits/arm-billingbenefits/tsconfig.json index 760424f2c47c..3e6ae96443f3 100644 --- a/sdk/billingbenefits/arm-billingbenefits/tsconfig.json +++ b/sdk/billingbenefits/arm-billingbenefits/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-billingbenefits": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"