From 84c1ed6ac332242c49c61d1294225b6935035e1b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 29 Oct 2024 02:30:48 +0000 Subject: [PATCH] CodeGen from PR 3550 in test-repo-billy/azure-rest-api-specs Merge 4f8fd6dc627c9799b2a36d7743472f614f2505b5 into 152d42215263aa8bd9e2d635120581fff0d14608 --- .../Sample_AppComplianceReportCollection.cs | 149 ---------- ...e_AppComplianceReportEvidenceCollection.cs | 157 ----------- ...ple_AppComplianceReportEvidenceResource.cs | 101 ------- .../Sample_AppComplianceReportResource.cs | 258 ------------------ ...nceReportScopingConfigurationCollection.cs | 155 ----------- ...ianceReportScopingConfigurationResource.cs | 73 ----- ...e_AppComplianceReportSnapshotCollection.cs | 157 ----------- ...ple_AppComplianceReportSnapshotResource.cs | 47 ---- ...le_AppComplianceReportWebhookCollection.cs | 157 ----------- ...mple_AppComplianceReportWebhookResource.cs | 105 ------- .../Sample_TenantResourceExtensions.cs | 192 ------------- .../src/autorest.md | 2 +- 12 files changed, 1 insertion(+), 1552 deletions(-) delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportCollection.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceCollection.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceResource.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportResource.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationCollection.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationResource.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotCollection.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotResource.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookCollection.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookResource.cs delete mode 100644 sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_TenantResourceExtensions.cs diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportCollection.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportCollection.cs deleted file mode 100644 index d915be9e1dbf..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportCollection.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportCollection - { - // Report_List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ReportList() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_List.json - // this example is just showing the usage of "Report_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // get the collection of this AppComplianceReportResource - AppComplianceReportCollection collection = tenantResource.GetAppComplianceReports(); - - // invoke the operation and iterate over the result - AppComplianceReportCollectionGetAllOptions options = new AppComplianceReportCollectionGetAllOptions() { SkipToken = "1", Top = 100, OfferGuid = "00000000-0000-0000-0000-000000000000", ReportCreatorTenantId = "00000000-0000-0000-0000-000000000000" }; - await foreach (AppComplianceReportResource item in collection.GetAllAsync(options)) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Report_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_ReportGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Get.json - // this example is just showing the usage of "Report_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // get the collection of this AppComplianceReportResource - AppComplianceReportCollection collection = tenantResource.GetAppComplianceReports(); - - // invoke the operation - string reportName = "testReport"; - AppComplianceReportResource result = await collection.GetAsync(reportName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Report_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_ReportGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Get.json - // this example is just showing the usage of "Report_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // get the collection of this AppComplianceReportResource - AppComplianceReportCollection collection = tenantResource.GetAppComplianceReports(); - - // invoke the operation - string reportName = "testReport"; - bool result = await collection.ExistsAsync(reportName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_ReportGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Get.json - // this example is just showing the usage of "Report_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // get the collection of this AppComplianceReportResource - AppComplianceReportCollection collection = tenantResource.GetAppComplianceReports(); - - // invoke the operation - string reportName = "testReport"; - NullableResponse response = await collection.GetIfExistsAsync(reportName); - AppComplianceReportResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceCollection.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceCollection.cs deleted file mode 100644 index 83b49b938701..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceCollection.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportEvidenceCollection - { - // Evidence_ListByReport - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_EvidenceListByReport() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_ListByReport.json - // this example is just showing the usage of "Evidence_ListByReport" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "reportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportEvidenceResource - AppComplianceReportEvidenceCollection collection = appComplianceReport.GetAppComplianceReportEvidences(); - - // invoke the operation and iterate over the result - AppComplianceReportEvidenceCollectionGetAllOptions options = new AppComplianceReportEvidenceCollectionGetAllOptions() { }; - await foreach (AppComplianceReportEvidenceResource item in collection.GetAllAsync(options)) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportEvidenceData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Evidence_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_EvidenceGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Get.json - // this example is just showing the usage of "Evidence_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportEvidenceResource - AppComplianceReportEvidenceCollection collection = appComplianceReport.GetAppComplianceReportEvidences(); - - // invoke the operation - string evidenceName = "evidence1"; - AppComplianceReportEvidenceResource result = await collection.GetAsync(evidenceName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportEvidenceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Evidence_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_EvidenceGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Get.json - // this example is just showing the usage of "Evidence_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportEvidenceResource - AppComplianceReportEvidenceCollection collection = appComplianceReport.GetAppComplianceReportEvidences(); - - // invoke the operation - string evidenceName = "evidence1"; - bool result = await collection.ExistsAsync(evidenceName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Evidence_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_EvidenceGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Get.json - // this example is just showing the usage of "Evidence_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportEvidenceResource - AppComplianceReportEvidenceCollection collection = appComplianceReport.GetAppComplianceReportEvidences(); - - // invoke the operation - string evidenceName = "evidence1"; - NullableResponse response = await collection.GetIfExistsAsync(evidenceName); - AppComplianceReportEvidenceResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportEvidenceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceResource.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceResource.cs deleted file mode 100644 index 5df00b4527f5..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportEvidenceResource.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportEvidenceResource - { - // Evidence_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_EvidenceGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Get.json - // this example is just showing the usage of "Evidence_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportEvidenceResource created on azure - // for more information of creating AppComplianceReportEvidenceResource, please refer to the document of AppComplianceReportEvidenceResource - string reportName = "testReportName"; - string evidenceName = "evidence1"; - ResourceIdentifier appComplianceReportEvidenceResourceId = AppComplianceReportEvidenceResource.CreateResourceIdentifier(reportName, evidenceName); - AppComplianceReportEvidenceResource appComplianceReportEvidence = client.GetAppComplianceReportEvidenceResource(appComplianceReportEvidenceResourceId); - - // invoke the operation - AppComplianceReportEvidenceResource result = await appComplianceReportEvidence.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportEvidenceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Evidence_Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_EvidenceDelete() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Delete.json - // this example is just showing the usage of "Evidence_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportEvidenceResource created on azure - // for more information of creating AppComplianceReportEvidenceResource, please refer to the document of AppComplianceReportEvidenceResource - string reportName = "testReportName"; - string evidenceName = "evidence1"; - ResourceIdentifier appComplianceReportEvidenceResourceId = AppComplianceReportEvidenceResource.CreateResourceIdentifier(reportName, evidenceName); - AppComplianceReportEvidenceResource appComplianceReportEvidence = client.GetAppComplianceReportEvidenceResource(appComplianceReportEvidenceResourceId); - - // invoke the operation - await appComplianceReportEvidence.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Evidence_Download - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Download_EvidenceDownload() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Evidence_Download.json - // this example is just showing the usage of "Evidence_Download" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportEvidenceResource created on azure - // for more information of creating AppComplianceReportEvidenceResource, please refer to the document of AppComplianceReportEvidenceResource - string reportName = "testReportName"; - string evidenceName = "evidence1"; - ResourceIdentifier appComplianceReportEvidenceResourceId = AppComplianceReportEvidenceResource.CreateResourceIdentifier(reportName, evidenceName); - AppComplianceReportEvidenceResource appComplianceReportEvidence = client.GetAppComplianceReportEvidenceResource(appComplianceReportEvidenceResourceId); - - // invoke the operation - EvidenceFileDownloadRequestContent content = new EvidenceFileDownloadRequestContent(); - EvidenceFileDownloadResult result = await appComplianceReportEvidence.DownloadAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportResource.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportResource.cs deleted file mode 100644 index 1e17861dd07c..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportResource.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportResource - { - // Report_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_ReportGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Get.json - // this example is just showing the usage of "Report_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReport"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - AppComplianceReportResource result = await appComplianceReport.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Report_Update - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_ReportUpdate() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Update.json - // this example is just showing the usage of "Report_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - AppComplianceReportPatch patch = new AppComplianceReportPatch(); - ArmOperation lro = await appComplianceReport.UpdateAsync(WaitUntil.Completed, patch); - AppComplianceReportResource result = lro.Value; - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Report_Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_ReportDelete() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Delete.json - // this example is just showing the usage of "Report_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - await appComplianceReport.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Report_EvidenceCheckNameAvailability - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CheckAppComplianceReportNestedResourceNameAvailability_ReportEvidenceCheckNameAvailability() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Evidence_Check_Name_Availability.json - // this example is just showing the usage of "Report_NestedResourceCheckNameAvailability" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "reportABC"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - AppComplianceReportNameAvailabilityContent content = new AppComplianceReportNameAvailabilityContent(); - AppComplianceReportNameAvailabilityResult result = await appComplianceReport.CheckAppComplianceReportNestedResourceNameAvailabilityAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_SnapshotCheckNameAvailability - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CheckAppComplianceReportNestedResourceNameAvailability_ReportSnapshotCheckNameAvailability() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Snapshot_Check_Name_Availability.json - // this example is just showing the usage of "Report_NestedResourceCheckNameAvailability" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "reportABC"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - AppComplianceReportNameAvailabilityContent content = new AppComplianceReportNameAvailabilityContent(); - AppComplianceReportNameAvailabilityResult result = await appComplianceReport.CheckAppComplianceReportNestedResourceNameAvailabilityAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_WebhookCheckNameAvailability - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CheckAppComplianceReportNestedResourceNameAvailability_ReportWebhookCheckNameAvailability() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_NestedResourceCheckNameAvailability_Report_Webhook_Check_Name_Availability.json - // this example is just showing the usage of "Report_NestedResourceCheckNameAvailability" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "reportABC"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - AppComplianceReportNameAvailabilityContent content = new AppComplianceReportNameAvailabilityContent(); - AppComplianceReportNameAvailabilityResult result = await appComplianceReport.CheckAppComplianceReportNestedResourceNameAvailabilityAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_Fix - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Fix_ReportFix() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Fix.json - // this example is just showing the usage of "Report_Fix" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReport"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - ArmOperation lro = await appComplianceReport.FixAsync(WaitUntil.Completed); - ReportFixResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_GetScopingQuestions - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetScopingQuestions_ReportGetScopingQuestions() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetScopingQuestions.json - // this example is just showing the usage of "Report_GetScopingQuestions" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - ScopingQuestions result = await appComplianceReport.GetScopingQuestionsAsync(); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_Verify - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Verify_ReportVerify() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_Verify.json - // this example is just showing the usage of "Report_Verify" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReport"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // invoke the operation - ArmOperation lro = await appComplianceReport.VerifyAsync(WaitUntil.Completed); - ReportVerificationResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationCollection.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationCollection.cs deleted file mode 100644 index 7bf82fde837f..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationCollection.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportScopingConfigurationCollection - { - // ScopingConfiguration_List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ScopingConfigurationList() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_List.json - // this example is just showing the usage of "ScopingConfiguration_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportScopingConfigurationResource - AppComplianceReportScopingConfigurationCollection collection = appComplianceReport.GetAppComplianceReportScopingConfigurations(); - - // invoke the operation and iterate over the result - await foreach (AppComplianceReportScopingConfigurationResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportScopingConfigurationData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // ScopingConfiguration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_ScopingConfiguration() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Get.json - // this example is just showing the usage of "ScopingConfiguration_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportScopingConfigurationResource - AppComplianceReportScopingConfigurationCollection collection = appComplianceReport.GetAppComplianceReportScopingConfigurations(); - - // invoke the operation - string scopingConfigurationName = "default"; - AppComplianceReportScopingConfigurationResource result = await collection.GetAsync(scopingConfigurationName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportScopingConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // ScopingConfiguration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_ScopingConfiguration() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Get.json - // this example is just showing the usage of "ScopingConfiguration_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportScopingConfigurationResource - AppComplianceReportScopingConfigurationCollection collection = appComplianceReport.GetAppComplianceReportScopingConfigurations(); - - // invoke the operation - string scopingConfigurationName = "default"; - bool result = await collection.ExistsAsync(scopingConfigurationName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // ScopingConfiguration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_ScopingConfiguration() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Get.json - // this example is just showing the usage of "ScopingConfiguration_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportScopingConfigurationResource - AppComplianceReportScopingConfigurationCollection collection = appComplianceReport.GetAppComplianceReportScopingConfigurations(); - - // invoke the operation - string scopingConfigurationName = "default"; - NullableResponse response = await collection.GetIfExistsAsync(scopingConfigurationName); - AppComplianceReportScopingConfigurationResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportScopingConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationResource.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationResource.cs deleted file mode 100644 index 976405aed30f..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportScopingConfigurationResource.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportScopingConfigurationResource - { - // ScopingConfiguration - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_ScopingConfiguration() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Get.json - // this example is just showing the usage of "ScopingConfiguration_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportScopingConfigurationResource created on azure - // for more information of creating AppComplianceReportScopingConfigurationResource, please refer to the document of AppComplianceReportScopingConfigurationResource - string reportName = "testReportName"; - string scopingConfigurationName = "default"; - ResourceIdentifier appComplianceReportScopingConfigurationResourceId = AppComplianceReportScopingConfigurationResource.CreateResourceIdentifier(reportName, scopingConfigurationName); - AppComplianceReportScopingConfigurationResource appComplianceReportScopingConfiguration = client.GetAppComplianceReportScopingConfigurationResource(appComplianceReportScopingConfigurationResourceId); - - // invoke the operation - AppComplianceReportScopingConfigurationResource result = await appComplianceReportScopingConfiguration.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportScopingConfigurationData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // ScopingConfiguration_Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_ScopingConfigurationDelete() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ScopingConfiguration_Delete.json - // this example is just showing the usage of "ScopingConfiguration_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportScopingConfigurationResource created on azure - // for more information of creating AppComplianceReportScopingConfigurationResource, please refer to the document of AppComplianceReportScopingConfigurationResource - string reportName = "testReportName"; - string scopingConfigurationName = "default"; - ResourceIdentifier appComplianceReportScopingConfigurationResourceId = AppComplianceReportScopingConfigurationResource.CreateResourceIdentifier(reportName, scopingConfigurationName); - AppComplianceReportScopingConfigurationResource appComplianceReportScopingConfiguration = client.GetAppComplianceReportScopingConfigurationResource(appComplianceReportScopingConfigurationResourceId); - - // invoke the operation - await appComplianceReportScopingConfiguration.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotCollection.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotCollection.cs deleted file mode 100644 index aab5cc68c0ad..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotCollection.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportSnapshotCollection - { - // Snapshot_List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_SnapshotList() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_List.json - // this example is just showing the usage of "Snapshot_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportSnapshotResource - AppComplianceReportSnapshotCollection collection = appComplianceReport.GetAppComplianceReportSnapshots(); - - // invoke the operation and iterate over the result - AppComplianceReportSnapshotCollectionGetAllOptions options = new AppComplianceReportSnapshotCollectionGetAllOptions() { SkipToken = "1", Top = 100, OfferGuid = "00000000-0000-0000-0000-000000000001", ReportCreatorTenantId = "00000000-0000-0000-0000-000000000000" }; - await foreach (AppComplianceReportSnapshotResource item in collection.GetAllAsync(options)) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportSnapshotData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Snapshot_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_SnapshotGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Get.json - // this example is just showing the usage of "Snapshot_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportSnapshotResource - AppComplianceReportSnapshotCollection collection = appComplianceReport.GetAppComplianceReportSnapshots(); - - // invoke the operation - string snapshotName = "testSnapshot"; - AppComplianceReportSnapshotResource result = await collection.GetAsync(snapshotName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportSnapshotData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Snapshot_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_SnapshotGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Get.json - // this example is just showing the usage of "Snapshot_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportSnapshotResource - AppComplianceReportSnapshotCollection collection = appComplianceReport.GetAppComplianceReportSnapshots(); - - // invoke the operation - string snapshotName = "testSnapshot"; - bool result = await collection.ExistsAsync(snapshotName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Snapshot_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_SnapshotGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Get.json - // this example is just showing the usage of "Snapshot_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportSnapshotResource - AppComplianceReportSnapshotCollection collection = appComplianceReport.GetAppComplianceReportSnapshots(); - - // invoke the operation - string snapshotName = "testSnapshot"; - NullableResponse response = await collection.GetIfExistsAsync(snapshotName); - AppComplianceReportSnapshotResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportSnapshotData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotResource.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotResource.cs deleted file mode 100644 index eb18c8130ed7..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportSnapshotResource.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportSnapshotResource - { - // Snapshot_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_SnapshotGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Snapshot_Get.json - // this example is just showing the usage of "Snapshot_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportSnapshotResource created on azure - // for more information of creating AppComplianceReportSnapshotResource, please refer to the document of AppComplianceReportSnapshotResource - string reportName = "testReportName"; - string snapshotName = "testSnapshot"; - ResourceIdentifier appComplianceReportSnapshotResourceId = AppComplianceReportSnapshotResource.CreateResourceIdentifier(reportName, snapshotName); - AppComplianceReportSnapshotResource appComplianceReportSnapshot = client.GetAppComplianceReportSnapshotResource(appComplianceReportSnapshotResourceId); - - // invoke the operation - AppComplianceReportSnapshotResource result = await appComplianceReportSnapshot.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportSnapshotData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookCollection.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookCollection.cs deleted file mode 100644 index 3c20de376b43..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookCollection.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportWebhookCollection - { - // Webhook_List - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_WebhookList() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_List.json - // this example is just showing the usage of "Webhook_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportWebhookResource - AppComplianceReportWebhookCollection collection = appComplianceReport.GetAppComplianceReportWebhooks(); - - // invoke the operation and iterate over the result - AppComplianceReportWebhookCollectionGetAllOptions options = new AppComplianceReportWebhookCollectionGetAllOptions() { SkipToken = "1", Top = 100 }; - await foreach (AppComplianceReportWebhookResource item in collection.GetAllAsync(options)) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportWebhookData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - - // Webhook_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_WebhookGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Get.json - // this example is just showing the usage of "Webhook_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportWebhookResource - AppComplianceReportWebhookCollection collection = appComplianceReport.GetAppComplianceReportWebhooks(); - - // invoke the operation - string webhookName = "testWebhookName"; - AppComplianceReportWebhookResource result = await collection.GetAsync(webhookName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportWebhookData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Webhook_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_WebhookGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Get.json - // this example is just showing the usage of "Webhook_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportWebhookResource - AppComplianceReportWebhookCollection collection = appComplianceReport.GetAppComplianceReportWebhooks(); - - // invoke the operation - string webhookName = "testWebhookName"; - bool result = await collection.ExistsAsync(webhookName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Webhook_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_WebhookGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Get.json - // this example is just showing the usage of "Webhook_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportResource created on azure - // for more information of creating AppComplianceReportResource, please refer to the document of AppComplianceReportResource - string reportName = "testReportName"; - ResourceIdentifier appComplianceReportResourceId = AppComplianceReportResource.CreateResourceIdentifier(reportName); - AppComplianceReportResource appComplianceReport = client.GetAppComplianceReportResource(appComplianceReportResourceId); - - // get the collection of this AppComplianceReportWebhookResource - AppComplianceReportWebhookCollection collection = appComplianceReport.GetAppComplianceReportWebhooks(); - - // invoke the operation - string webhookName = "testWebhookName"; - NullableResponse response = await collection.GetIfExistsAsync(webhookName); - AppComplianceReportWebhookResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportWebhookData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookResource.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookResource.cs deleted file mode 100644 index deb744435a34..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_AppComplianceReportWebhookResource.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_AppComplianceReportWebhookResource - { - // Webhook_Get - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_WebhookGet() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Get.json - // this example is just showing the usage of "Webhook_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportWebhookResource created on azure - // for more information of creating AppComplianceReportWebhookResource, please refer to the document of AppComplianceReportWebhookResource - string reportName = "testReportName"; - string webhookName = "testWebhookName"; - ResourceIdentifier appComplianceReportWebhookResourceId = AppComplianceReportWebhookResource.CreateResourceIdentifier(reportName, webhookName); - AppComplianceReportWebhookResource appComplianceReportWebhook = client.GetAppComplianceReportWebhookResource(appComplianceReportWebhookResourceId); - - // invoke the operation - AppComplianceReportWebhookResource result = await appComplianceReportWebhook.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportWebhookData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Webhook_Update - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_WebhookUpdate() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Update.json - // this example is just showing the usage of "Webhook_Update" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportWebhookResource created on azure - // for more information of creating AppComplianceReportWebhookResource, please refer to the document of AppComplianceReportWebhookResource - string reportName = "testReportName"; - string webhookName = "testWebhookName"; - ResourceIdentifier appComplianceReportWebhookResourceId = AppComplianceReportWebhookResource.CreateResourceIdentifier(reportName, webhookName); - AppComplianceReportWebhookResource appComplianceReportWebhook = client.GetAppComplianceReportWebhookResource(appComplianceReportWebhookResourceId); - - // invoke the operation - AppComplianceReportWebhookPatch patch = new AppComplianceReportWebhookPatch(); - AppComplianceReportWebhookResource result = await appComplianceReportWebhook.UpdateAsync(patch); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - AppComplianceReportWebhookData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Webhook_Delete - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_WebhookDelete() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Webhook_Delete.json - // this example is just showing the usage of "Webhook_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this AppComplianceReportWebhookResource created on azure - // for more information of creating AppComplianceReportWebhookResource, please refer to the document of AppComplianceReportWebhookResource - string reportName = "testReportName"; - string webhookName = "testWebhookName"; - ResourceIdentifier appComplianceReportWebhookResourceId = AppComplianceReportWebhookResource.CreateResourceIdentifier(reportName, webhookName); - AppComplianceReportWebhookResource appComplianceReportWebhook = client.GetAppComplianceReportWebhookResource(appComplianceReportWebhookResourceId); - - // invoke the operation - await appComplianceReportWebhook.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_TenantResourceExtensions.cs deleted file mode 100644 index 9f4eaaf2dbb6..000000000000 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/samples/Generated/Samples/Sample_TenantResourceExtensions.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.AppComplianceAutomation.Models; - -namespace Azure.ResourceManager.AppComplianceAutomation.Samples -{ - public partial class Sample_TenantResourceExtensions - { - // Report_CheckNameAvailability - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CheckAppComplianceReportNameAvailability_ReportCheckNameAvailability() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_CheckNameAvailability.json - // this example is just showing the usage of "ProviderActions_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // invoke the operation - AppComplianceReportNameAvailabilityContent content = new AppComplianceReportNameAvailabilityContent(); - AppComplianceReportNameAvailabilityResult result = await tenantResource.CheckAppComplianceReportNameAvailabilityAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_GetCollectionCount - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetCollectionCountProviderAction_ReportGetCollectionCount() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetCollectionCount.json - // this example is just showing the usage of "ProviderActions_GetCollectionCount" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // invoke the operation - ReportCollectionGetCountContent content = new ReportCollectionGetCountContent(); - ReportCollectionGetCountResult result = await tenantResource.GetCollectionCountProviderActionAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Report_GetOverviewStatus - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetOverviewStatusProviderAction_ReportGetOverviewStatus() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Report_GetOverviewStatus.json - // this example is just showing the usage of "ProviderActions_GetOverviewStatus" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // invoke the operation - AppComplianceGetOverviewStatusContent content = new AppComplianceGetOverviewStatusContent(); - AppComplianceGetOverviewStatusResult result = await tenantResource.GetOverviewStatusProviderActionAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // ListInUseStorageAccountsWithSubscriptions - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetInUseStorageAccountsProviderAction_ListInUseStorageAccountsWithSubscriptions() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithSubscriptions.json - // this example is just showing the usage of "ProviderActions_ListInUseStorageAccounts" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // invoke the operation - ReportListInUseStorageAccountsContent content = new ReportListInUseStorageAccountsContent(); - ReportListInUseStorageAccountsResult result = await tenantResource.GetInUseStorageAccountsProviderActionAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // ListInUseStorageAccountsWithoutSubscriptions - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetInUseStorageAccountsProviderAction_ListInUseStorageAccountsWithoutSubscriptions() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/ListInUseStorageAccountsWithoutSubscriptions.json - // this example is just showing the usage of "ProviderActions_ListInUseStorageAccounts" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // invoke the operation - ReportListInUseStorageAccountsContent content = new ReportListInUseStorageAccountsContent(); - ReportListInUseStorageAccountsResult result = await tenantResource.GetInUseStorageAccountsProviderActionAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Onboard - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task OnboardProviderAction_Onboard() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/Onboard.json - // this example is just showing the usage of "ProviderActions_Onboard" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // invoke the operation - AppComplianceOnboardContent content = new AppComplianceOnboardContent(new string[] - { - }); - ArmOperation lro = await tenantResource.OnboardProviderActionAsync(WaitUntil.Completed, content); - AppComplianceOnboardResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - - // TriggerEvaluation - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task TriggerEvaluationProviderAction_TriggerEvaluation() - { - // Generated from example definition: specification/appcomplianceautomation/resource-manager/Microsoft.AppComplianceAutomation/stable/2024-06-27/examples/TriggerEvaluation.json - // this example is just showing the usage of "ProviderActions_TriggerEvaluation" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this TenantResource created on azure - // for more information of creating TenantResource, please refer to the document of TenantResource - var tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; - - // invoke the operation - TriggerEvaluationContent content = new TriggerEvaluationContent(new string[] - { - }); - ArmOperation lro = await tenantResource.TriggerEvaluationProviderActionAsync(WaitUntil.Completed, content); - TriggerEvaluationResult result = lro.Value; - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/autorest.md b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/autorest.md index 6be2dc492a58..969865e0404f 100644 --- a/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/autorest.md +++ b/sdk/appcomplianceautomation/Azure.ResourceManager.AppComplianceAutomation/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: AppComplianceAutomation namespace: Azure.ResourceManager.AppComplianceAutomation -require: https://github.com/Azure/azure-rest-api-specs/blob/f28f14c35918513bd3c3cf9f30d31ee192602525/specification/appcomplianceautomation/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appcomplianceautomation/resource-manager/readme.md #tag: package-2024-06 output-folder: $(this-folder)/Generated clear-output-folder: true