From efa621d8291b2f1b48def0bb6a5332da01bd635f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 26 Feb 2025 00:21:14 +0000 Subject: [PATCH] CodeGen from PR 32818 in Azure/azure-rest-api-specs Merge 37a3cb42ea87cb9827af462afaa3ec3f85abd8d0 into 5eebf11c2c98feded3199df1a68ccf6d2c626d63 --- ...ample_BatchAccountCertificateCollection.cs | 133 +- .../Sample_BatchAccountDetectorCollection.cs | 49 +- .../Sample_BatchAccountPoolCollection.cs | 445 +++---- .../Sample_BatchApplicationCollection.cs | 61 +- ...atchPrivateEndpointConnectionCollection.cs | 49 +- ...mple_BatchPrivateLinkResourceCollection.cs | 49 +- ...ecurityPerimeterConfigurationCollection.cs | 49 +- .../Sample_ResourceGroupResourceExtensions.cs | 152 +++ .../Sample_SubscriptionResourceExtensions.cs | 8 +- .../src/Generated/ArmBatchModelFactory.cs | 98 +- .../BatchAccountCertificateCollection.cs | 44 +- .../BatchAccountCertificateResource.cs | 3 +- .../src/Generated/BatchAccountCollection.cs | 495 -------- .../BatchAccountDetectorCollection.cs | 36 +- .../Generated/BatchAccountDetectorResource.cs | 3 +- .../Generated/BatchAccountPoolCollection.cs | 44 +- .../src/Generated/BatchAccountPoolData.cs | 4 +- .../src/Generated/BatchAccountPoolResource.cs | 3 +- .../BatchAccountResource.Serialization.cs | 26 - .../src/Generated/BatchAccountResource.cs | 1120 ----------------- .../Generated/BatchApplicationCollection.cs | 44 +- .../src/Generated/BatchApplicationResource.cs | 3 +- ...atchPrivateEndpointConnectionCollection.cs | 36 +- .../BatchPrivateEndpointConnectionResource.cs | 3 +- .../src/Generated/BatchPrivateLinkResource.cs | 3 +- .../BatchPrivateLinkResourceCollection.cs | 36 +- .../Generated/Extensions/BatchExtensions.cs | 1013 ++++++++++++++- .../Extensions/MockableBatchArmClient.cs | 12 - .../MockableBatchResourceGroupResource.cs | 846 ++++++++++++- .../MockableBatchSubscriptionResource.cs | 32 +- .../BatchAccountOperationSource.cs | 38 - .../Models/AutomaticOSUpgradePolicy.cs | 4 +- .../BatchAccount.Serialization.cs} | 41 +- .../BatchAccount.cs} | 18 +- ...atchAccountAutoStorageBaseConfiguration.cs | 16 +- .../BatchAccountAutoStorageConfiguration.cs | 4 +- ...ountCreateOrUpdateContent.Serialization.cs | 317 ----- .../BatchAccountCreateOrUpdateContent.cs | 112 -- .../BatchAccountEncryptionConfiguration.cs | 14 +- .../BatchAccountListResult.Serialization.cs | 8 +- .../Models/BatchAccountListResult.cs | 6 +- .../Models/BatchAccountPatch.Serialization.cs | 276 ---- .../src/Generated/Models/BatchAccountPatch.cs | 92 -- .../Models/BatchDiffDiskPlacement.cs | 2 +- .../Generated/Models/BatchImageReference.cs | 4 +- .../Generated/Models/BatchInboundNatPool.cs | 6 +- .../Models/BatchKeyVaultReference.cs | 6 +- .../Models/BatchNetworkConfiguration.cs | 4 +- .../src/Generated/Models/BatchOSDisk.cs | 2 +- .../src/Generated/Models/DiffDiskSettings.cs | 4 +- .../Generated/Models/KeyVaultProperties.cs | 4 +- ...ecurityPerimeterConfigurationCollection.cs | 36 +- ...kSecurityPerimeterConfigurationResource.cs | 3 +- .../BatchAccountRestOperations.cs | 382 +----- .../src/autorest.md | 2 +- sdk/resourcemanager/ci.mgmt.yml | 4 +- 56 files changed, 2687 insertions(+), 3617 deletions(-) create mode 100644 sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCollection.cs delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.Serialization.cs delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/LongRunningOperation/BatchAccountOperationSource.cs rename sdk/batch/Azure.ResourceManager.Batch/src/Generated/{BatchAccountData.Serialization.cs => Models/BatchAccount.Serialization.cs} (93%) rename sdk/batch/Azure.ResourceManager.Batch/src/Generated/{BatchAccountData.cs => Models/BatchAccount.cs} (88%) delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.Serialization.cs delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.cs delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.Serialization.cs delete mode 100644 sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.cs diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountCertificateCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountCertificateCollection.cs index a069e377c486..43f85f1b0ea1 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountCertificateCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountCertificateCollection.cs @@ -10,6 +10,7 @@ using Azure.Core; using Azure.Identity; using Azure.ResourceManager.Batch.Models; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.Batch.Samples @@ -28,16 +29,16 @@ public async Task CreateOrUpdate_CreateCertificateFull() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -71,16 +72,16 @@ public async Task CreateOrUpdate_CreateCertificateMinimalCer() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -111,16 +112,16 @@ public async Task CreateOrUpdate_CreateCertificateMinimalPfx() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -151,16 +152,16 @@ public async Task Get_GetCertificate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -185,16 +186,16 @@ public async Task Get_GetCertificateWithDeletionError() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -219,16 +220,16 @@ public async Task GetAll_ListCertificates() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation and iterate over the result await foreach (BatchAccountCertificateResource item in collection.GetAllAsync()) @@ -255,16 +256,16 @@ public async Task GetAll_ListCertificatesFilterAndSelect() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation and iterate over the result string select = "properties/format,properties/provisioningState"; @@ -293,16 +294,16 @@ public async Task Exists_GetCertificate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -323,16 +324,16 @@ public async Task Exists_GetCertificateWithDeletionError() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -353,16 +354,16 @@ public async Task GetIfExists_GetCertificate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; @@ -395,16 +396,16 @@ public async Task GetIfExists_GetCertificateWithDeletionError() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountCertificateResource - BatchAccountCertificateCollection collection = batchAccount.GetBatchAccountCertificates(); + string accountName = "sampleacct"; + BatchAccountCertificateCollection collection = resourceGroupResource.GetBatchAccountCertificates(accountName); // invoke the operation string certificateName = "sha1-0a0e4f50d51beadeac1d35afc5116098e7902e6e"; diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountDetectorCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountDetectorCollection.cs index c3167fbd771a..4a3d13ac88d1 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountDetectorCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountDetectorCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.Batch.Samples @@ -27,16 +28,16 @@ public async Task Get_GetDetector() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountDetectorResource - BatchAccountDetectorCollection collection = batchAccount.GetBatchAccountDetectors(); + string accountName = "sampleacct"; + BatchAccountDetectorCollection collection = resourceGroupResource.GetBatchAccountDetectors(accountName); // invoke the operation string detectorId = "poolsAndNodes"; @@ -61,16 +62,16 @@ public async Task GetAll_ListDetectors() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountDetectorResource - BatchAccountDetectorCollection collection = batchAccount.GetBatchAccountDetectors(); + string accountName = "sampleacct"; + BatchAccountDetectorCollection collection = resourceGroupResource.GetBatchAccountDetectors(accountName); // invoke the operation and iterate over the result await foreach (BatchAccountDetectorResource item in collection.GetAllAsync()) @@ -97,16 +98,16 @@ public async Task Exists_GetDetector() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountDetectorResource - BatchAccountDetectorCollection collection = batchAccount.GetBatchAccountDetectors(); + string accountName = "sampleacct"; + BatchAccountDetectorCollection collection = resourceGroupResource.GetBatchAccountDetectors(accountName); // invoke the operation string detectorId = "poolsAndNodes"; @@ -127,16 +128,16 @@ public async Task GetIfExists_GetDetector() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountDetectorResource - BatchAccountDetectorCollection collection = batchAccount.GetBatchAccountDetectors(); + string accountName = "sampleacct"; + BatchAccountDetectorCollection collection = resourceGroupResource.GetBatchAccountDetectors(accountName); // invoke the operation string detectorId = "poolsAndNodes"; diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountPoolCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountPoolCollection.cs index 4a06d5a7999e..b293c7e3fc18 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountPoolCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchAccountPoolCollection.cs @@ -12,6 +12,7 @@ using Azure.Identity; using Azure.ResourceManager.Batch.Models; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.Batch.Samples @@ -30,16 +31,16 @@ public async Task CreateOrUpdate_CreatePoolCustomImage() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -73,16 +74,16 @@ public async Task CreateOrUpdate_CreatePoolFullVirtualMachineConfiguration() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -158,16 +159,16 @@ public async Task CreateOrUpdate_CreatePoolMinimalVirtualMachineConfiguration() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -211,16 +212,16 @@ public async Task CreateOrUpdate_CreatePoolNoPublicIP() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -262,16 +263,16 @@ public async Task CreateOrUpdate_CreatePoolPublicIPs() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -314,16 +315,16 @@ public async Task CreateOrUpdate_CreatePoolResourceTags() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -373,16 +374,16 @@ public async Task CreateOrUpdate_CreatePoolSecurityProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -439,16 +440,16 @@ public async Task CreateOrUpdate_CreatePoolTags() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -498,16 +499,16 @@ public async Task CreateOrUpdate_CreatePoolUpgradePolicy() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -576,16 +577,16 @@ public async Task CreateOrUpdate_CreatePoolUserAssignedIdentities() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -637,16 +638,16 @@ public async Task CreateOrUpdate_CreatePoolVirtualMachineConfigurationExtensions // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -703,16 +704,16 @@ public async Task CreateOrUpdate_CreatePoolVirtualMachineConfigurationOSDisk() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -768,16 +769,16 @@ public async Task CreateOrUpdate_CreatePoolVirtualMachineConfigurationServiceArt // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -833,16 +834,16 @@ public async Task CreateOrUpdate_CreatePoolAcceleratedNetworking() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -892,16 +893,16 @@ public async Task Get_GetPool() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -926,16 +927,16 @@ public async Task Get_GetPoolAcceleratedNetworking() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -960,16 +961,16 @@ public async Task Get_GetPoolSecurityProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -994,16 +995,16 @@ public async Task Get_GetPoolUpgradePolicy() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1028,16 +1029,16 @@ public async Task Get_GetPoolVirtualMachineConfigurationExtensions() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1062,16 +1063,16 @@ public async Task Get_GetPoolVirtualMachineConfigurationOSDisk() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1096,16 +1097,16 @@ public async Task Get_GetPoolVirtualMachineConfigurationServiceArtifactReference // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1130,16 +1131,16 @@ public async Task GetAll_ListPool() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation and iterate over the result await foreach (BatchAccountPoolResource item in collection.GetAllAsync()) @@ -1166,16 +1167,16 @@ public async Task GetAll_ListPoolWithFilter() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation and iterate over the result string select = "properties/allocationState,properties/provisioningStateTransitionTime,properties/currentDedicatedNodes,properties/currentLowPriorityNodes"; @@ -1204,16 +1205,16 @@ public async Task Exists_GetPool() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1234,16 +1235,16 @@ public async Task Exists_GetPoolAcceleratedNetworking() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1264,16 +1265,16 @@ public async Task Exists_GetPoolSecurityProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1294,16 +1295,16 @@ public async Task Exists_GetPoolUpgradePolicy() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1324,16 +1325,16 @@ public async Task Exists_GetPoolVirtualMachineConfigurationExtensions() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1354,16 +1355,16 @@ public async Task Exists_GetPoolVirtualMachineConfigurationOSDisk() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1384,16 +1385,16 @@ public async Task Exists_GetPoolVirtualMachineConfigurationServiceArtifactRefere // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1414,16 +1415,16 @@ public async Task GetIfExists_GetPool() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1456,16 +1457,16 @@ public async Task GetIfExists_GetPoolAcceleratedNetworking() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1498,16 +1499,16 @@ public async Task GetIfExists_GetPoolSecurityProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1540,16 +1541,16 @@ public async Task GetIfExists_GetPoolUpgradePolicy() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1582,16 +1583,16 @@ public async Task GetIfExists_GetPoolVirtualMachineConfigurationExtensions() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1624,16 +1625,16 @@ public async Task GetIfExists_GetPoolVirtualMachineConfigurationOSDisk() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; @@ -1666,16 +1667,16 @@ public async Task GetIfExists_GetPoolVirtualMachineConfigurationServiceArtifactR // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchAccountPoolResource - BatchAccountPoolCollection collection = batchAccount.GetBatchAccountPools(); + string accountName = "sampleacct"; + BatchAccountPoolCollection collection = resourceGroupResource.GetBatchAccountPools(accountName); // invoke the operation string poolName = "testpool"; diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchApplicationCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchApplicationCollection.cs index f48730e8f52c..273bc8dd1f43 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchApplicationCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchApplicationCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.Batch.Samples @@ -27,16 +28,16 @@ public async Task CreateOrUpdate_ApplicationCreate() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchApplicationResource - BatchApplicationCollection collection = batchAccount.GetBatchApplications(); + string accountName = "sampleacct"; + BatchApplicationCollection collection = resourceGroupResource.GetBatchApplications(accountName); // invoke the operation string applicationName = "app1"; @@ -67,16 +68,16 @@ public async Task Get_ApplicationGet() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchApplicationResource - BatchApplicationCollection collection = batchAccount.GetBatchApplications(); + string accountName = "sampleacct"; + BatchApplicationCollection collection = resourceGroupResource.GetBatchApplications(accountName); // invoke the operation string applicationName = "app1"; @@ -101,16 +102,16 @@ public async Task GetAll_ApplicationList() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchApplicationResource - BatchApplicationCollection collection = batchAccount.GetBatchApplications(); + string accountName = "sampleacct"; + BatchApplicationCollection collection = resourceGroupResource.GetBatchApplications(accountName); // invoke the operation and iterate over the result await foreach (BatchApplicationResource item in collection.GetAllAsync()) @@ -137,16 +138,16 @@ public async Task Exists_ApplicationGet() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchApplicationResource - BatchApplicationCollection collection = batchAccount.GetBatchApplications(); + string accountName = "sampleacct"; + BatchApplicationCollection collection = resourceGroupResource.GetBatchApplications(accountName); // invoke the operation string applicationName = "app1"; @@ -167,16 +168,16 @@ public async Task GetIfExists_ApplicationGet() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchApplicationResource - BatchApplicationCollection collection = batchAccount.GetBatchApplications(); + string accountName = "sampleacct"; + BatchApplicationCollection collection = resourceGroupResource.GetBatchApplications(accountName); // invoke the operation string applicationName = "app1"; diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateEndpointConnectionCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateEndpointConnectionCollection.cs index cf6f27a4725f..3efadf397e28 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateEndpointConnectionCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateEndpointConnectionCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.Batch.Samples @@ -27,16 +28,16 @@ public async Task Get_GetPrivateEndpointConnection() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateEndpointConnectionResource - BatchPrivateEndpointConnectionCollection collection = batchAccount.GetBatchPrivateEndpointConnections(); + string accountName = "sampleacct"; + BatchPrivateEndpointConnectionCollection collection = resourceGroupResource.GetBatchPrivateEndpointConnections(accountName); // invoke the operation string privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -61,16 +62,16 @@ public async Task GetAll_ListPrivateEndpointConnections() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateEndpointConnectionResource - BatchPrivateEndpointConnectionCollection collection = batchAccount.GetBatchPrivateEndpointConnections(); + string accountName = "sampleacct"; + BatchPrivateEndpointConnectionCollection collection = resourceGroupResource.GetBatchPrivateEndpointConnections(accountName); // invoke the operation and iterate over the result await foreach (BatchPrivateEndpointConnectionResource item in collection.GetAllAsync()) @@ -97,16 +98,16 @@ public async Task Exists_GetPrivateEndpointConnection() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateEndpointConnectionResource - BatchPrivateEndpointConnectionCollection collection = batchAccount.GetBatchPrivateEndpointConnections(); + string accountName = "sampleacct"; + BatchPrivateEndpointConnectionCollection collection = resourceGroupResource.GetBatchPrivateEndpointConnections(accountName); // invoke the operation string privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; @@ -127,16 +128,16 @@ public async Task GetIfExists_GetPrivateEndpointConnection() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateEndpointConnectionResource - BatchPrivateEndpointConnectionCollection collection = batchAccount.GetBatchPrivateEndpointConnections(); + string accountName = "sampleacct"; + BatchPrivateEndpointConnectionCollection collection = resourceGroupResource.GetBatchPrivateEndpointConnections(accountName); // invoke the operation string privateEndpointConnectionName = "testprivateEndpointConnection5testprivateEndpointConnection5.24d6b4b5-e65c-4330-bbe9-3a290d62f8e0"; diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateLinkResourceCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateLinkResourceCollection.cs index 2eaf4bc4f915..5a18474846e3 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateLinkResourceCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_BatchPrivateLinkResourceCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.Batch.Samples @@ -27,16 +28,16 @@ public async Task Get_GetPrivateLinkResource() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateLinkResource - BatchPrivateLinkResourceCollection collection = batchAccount.GetBatchPrivateLinkResources(); + string accountName = "sampleacct"; + BatchPrivateLinkResourceCollection collection = resourceGroupResource.GetBatchPrivateLinkResources(accountName); // invoke the operation string privateLinkResourceName = "batchAccount"; @@ -61,16 +62,16 @@ public async Task GetAll_ListPrivateLinkResource() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateLinkResource - BatchPrivateLinkResourceCollection collection = batchAccount.GetBatchPrivateLinkResources(); + string accountName = "sampleacct"; + BatchPrivateLinkResourceCollection collection = resourceGroupResource.GetBatchPrivateLinkResources(accountName); // invoke the operation and iterate over the result await foreach (BatchPrivateLinkResource item in collection.GetAllAsync()) @@ -97,16 +98,16 @@ public async Task Exists_GetPrivateLinkResource() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateLinkResource - BatchPrivateLinkResourceCollection collection = batchAccount.GetBatchPrivateLinkResources(); + string accountName = "sampleacct"; + BatchPrivateLinkResourceCollection collection = resourceGroupResource.GetBatchPrivateLinkResources(accountName); // invoke the operation string privateLinkResourceName = "batchAccount"; @@ -127,16 +128,16 @@ public async Task GetIfExists_GetPrivateLinkResource() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this BatchPrivateLinkResource - BatchPrivateLinkResourceCollection collection = batchAccount.GetBatchPrivateLinkResources(); + string accountName = "sampleacct"; + BatchPrivateLinkResourceCollection collection = resourceGroupResource.GetBatchPrivateLinkResources(accountName); // invoke the operation string privateLinkResourceName = "batchAccount"; diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs index 9f5acb1f10fd..836d87912508 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.Batch.Samples @@ -27,16 +28,16 @@ public async Task Get_GetNspConfiguration() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = batchAccount.GetNetworkSecurityPerimeterConfigurations(); + string accountName = "sampleacct"; + NetworkSecurityPerimeterConfigurationCollection collection = resourceGroupResource.GetNetworkSecurityPerimeterConfigurations(accountName); // invoke the operation string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.sampleassociation"; @@ -61,16 +62,16 @@ public async Task GetAll_ListNspConfigurations() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = batchAccount.GetNetworkSecurityPerimeterConfigurations(); + string accountName = "sampleacct"; + NetworkSecurityPerimeterConfigurationCollection collection = resourceGroupResource.GetNetworkSecurityPerimeterConfigurations(accountName); // invoke the operation and iterate over the result await foreach (NetworkSecurityPerimeterConfigurationResource item in collection.GetAllAsync()) @@ -97,16 +98,16 @@ public async Task Exists_GetNspConfiguration() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = batchAccount.GetNetworkSecurityPerimeterConfigurations(); + string accountName = "sampleacct"; + NetworkSecurityPerimeterConfigurationCollection collection = resourceGroupResource.GetNetworkSecurityPerimeterConfigurations(accountName); // invoke the operation string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.sampleassociation"; @@ -127,16 +128,16 @@ public async Task GetIfExists_GetNspConfiguration() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this BatchAccountResource created on azure - // for more information of creating BatchAccountResource, please refer to the document of BatchAccountResource + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource string subscriptionId = "subid"; string resourceGroupName = "default-azurebatch-japaneast"; - string accountName = "sampleacct"; - ResourceIdentifier batchAccountResourceId = BatchAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); - BatchAccountResource batchAccount = client.GetBatchAccountResource(batchAccountResourceId); + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); // get the collection of this NetworkSecurityPerimeterConfigurationResource - NetworkSecurityPerimeterConfigurationCollection collection = batchAccount.GetNetworkSecurityPerimeterConfigurations(); + string accountName = "sampleacct"; + NetworkSecurityPerimeterConfigurationCollection collection = resourceGroupResource.GetNetworkSecurityPerimeterConfigurations(accountName); // invoke the operation string networkSecurityPerimeterConfigurationName = "00000000-0000-0000-0000-000000000000.sampleassociation"; diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs new file mode 100644 index 000000000000..837006363b6b --- /dev/null +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -0,0 +1,152 @@ +// 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.Batch.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Batch.Samples +{ + public partial class Sample_ResourceGroupResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetBatchAccountsByResourceGroup_BatchAccountListByResourceGroup() + { + // Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountListByResourceGroup.json + // this example is just showing the usage of "BatchAccount_ListByResourceGroup" 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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "default-azurebatch-japaneast"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation and iterate over the result + await foreach (BatchAccount item in resourceGroupResource.GetBatchAccountsByResourceGroupAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task SynchronizeAutoStorageKeysBatchAccount_BatchAccountSynchronizeAutoStorageKeys() + { + // Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountSynchronizeAutoStorageKeys.json + // this example is just showing the usage of "BatchAccount_SynchronizeAutoStorageKeys" 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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "default-azurebatch-japaneast"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + await resourceGroupResource.SynchronizeAutoStorageKeysBatchAccountAsync(); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task RegenerateKeyBatchAccount_BatchAccountRegenerateKey() + { + // Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountRegenerateKey.json + // this example is just showing the usage of "BatchAccount_RegenerateKey" 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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "default-azurebatch-japaneast"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + BatchAccountRegenerateKeyContent content = new BatchAccountRegenerateKeyContent(BatchAccountKeyType.Primary); + BatchAccountKeys result = await resourceGroupResource.RegenerateKeyBatchAccountAsync(content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetKeysBatchAccount_BatchAccountGetKeys() + { + // Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountGetKeys.json + // this example is just showing the usage of "BatchAccount_GetKeys" 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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "default-azurebatch-japaneast"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + BatchAccountKeys result = await resourceGroupResource.GetKeysBatchAccountAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOutboundNetworkDependenciesEndpointsBatchAccounts_ListOutboundNetworkDependencies() + { + // Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-07-01/examples/BatchAccountListOutboundNetworkDependenciesEndpoints.json + // this example is just showing the usage of "BatchAccount_ListOutboundNetworkDependenciesEndpoints" 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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "subid"; + string resourceGroupName = "default-azurebatch-japaneast"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation and iterate over the result + await foreach (BatchAccountOutboundEnvironmentEndpoint item in resourceGroupResource.GetOutboundNetworkDependenciesEndpointsBatchAccountsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 01fb1a6bda6e..6a4c60c41374 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -36,13 +36,9 @@ public async Task GetBatchAccounts_BatchAccountList() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (BatchAccountResource item in subscriptionResource.GetBatchAccountsAsync()) + await foreach (BatchAccount item in subscriptionResource.GetBatchAccountsAsync()) { - // 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 - BatchAccountData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + Console.WriteLine($"Succeeded: {item}"); } Console.WriteLine("Succeeded"); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs index 323aebfd1b45..3b71f47a9bf4 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/ArmBatchModelFactory.cs @@ -17,47 +17,7 @@ namespace Azure.ResourceManager.Batch.Models /// Model factory for models. public static partial class ArmBatchModelFactory { - /// Initializes a new instance of . - /// The region in which to create the account. - /// The user-specified tags associated with the account. - /// The identity of the Batch account. Current supported identity types: None, SystemAssigned, UserAssigned. - /// The properties related to the auto-storage account. - /// The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Microsoft Entra ID. If the mode is UserSubscription, clients must use Microsoft Entra ID. The default is BatchService. - /// A reference to the Azure key vault associated with the Batch account. - /// If not specified, the default value is 'enabled'. - /// The network profile only takes effect when publicNetworkAccess is enabled. - /// Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. - /// List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. - /// A new instance for mocking. - public static BatchAccountCreateOrUpdateContent BatchAccountCreateOrUpdateContent(AzureLocation location = default, IDictionary tags = null, ManagedServiceIdentity identity = null, BatchAccountAutoStorageBaseConfiguration autoStorage = null, BatchAccountPoolAllocationMode? poolAllocationMode = null, BatchKeyVaultReference keyVaultReference = null, BatchPublicNetworkAccess? publicNetworkAccess = null, BatchNetworkProfile networkProfile = null, BatchAccountEncryptionConfiguration encryption = null, IEnumerable allowedAuthenticationModes = null) - { - tags ??= new Dictionary(); - allowedAuthenticationModes ??= new List(); - - return new BatchAccountCreateOrUpdateContent( - location, - tags, - identity, - autoStorage, - poolAllocationMode, - keyVaultReference, - publicNetworkAccess, - networkProfile, - encryption, - allowedAuthenticationModes?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Action when client IP address is matched. - /// IPv4 address, or IPv4 address range in CIDR format. - /// A new instance for mocking. - public static BatchIPRule BatchIPRule(BatchIPRuleAction action = default, string value = null) - { - return new BatchIPRule(action, value, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -82,15 +42,15 @@ public static BatchIPRule BatchIPRule(BatchIPRuleAction action = default, string /// List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. /// The location of the resource. /// The tags of the resource. - /// A new instance for mocking. - public static BatchAccountData BatchAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedServiceIdentity identity = null, string accountEndpoint = null, string nodeManagementEndpoint = null, BatchProvisioningState? provisioningState = null, BatchAccountPoolAllocationMode? poolAllocationMode = null, BatchKeyVaultReference keyVaultReference = null, BatchPublicNetworkAccess? publicNetworkAccess = null, BatchNetworkProfile networkProfile = null, IEnumerable privateEndpointConnections = null, BatchAccountAutoStorageConfiguration autoStorage = null, BatchAccountEncryptionConfiguration encryption = null, int? dedicatedCoreQuota = null, int? lowPriorityCoreQuota = null, IEnumerable dedicatedCoreQuotaPerVmFamily = null, bool? isDedicatedCoreQuotaPerVmFamilyEnforced = null, int? poolQuota = null, int? activeJobAndJobScheduleQuota = null, IEnumerable allowedAuthenticationModes = null, AzureLocation? location = null, IReadOnlyDictionary tags = null) + /// A new instance for mocking. + public static BatchAccount BatchAccount(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedServiceIdentity identity = null, string accountEndpoint = null, string nodeManagementEndpoint = null, BatchProvisioningState? provisioningState = null, BatchAccountPoolAllocationMode? poolAllocationMode = null, BatchKeyVaultReference keyVaultReference = null, BatchPublicNetworkAccess? publicNetworkAccess = null, BatchNetworkProfile networkProfile = null, IEnumerable privateEndpointConnections = null, BatchAccountAutoStorageConfiguration autoStorage = null, BatchAccountEncryptionConfiguration encryption = null, int? dedicatedCoreQuota = null, int? lowPriorityCoreQuota = null, IEnumerable dedicatedCoreQuotaPerVmFamily = null, bool? isDedicatedCoreQuotaPerVmFamilyEnforced = null, int? poolQuota = null, int? activeJobAndJobScheduleQuota = null, IEnumerable allowedAuthenticationModes = null, AzureLocation? location = null, IReadOnlyDictionary tags = null) { privateEndpointConnections ??= new List(); dedicatedCoreQuotaPerVmFamily ??= new List(); allowedAuthenticationModes ??= new List(); tags ??= new Dictionary(); - return new BatchAccountData( + return new BatchAccount( id, name, resourceType, @@ -118,6 +78,24 @@ public static BatchAccountData BatchAccountData(ResourceIdentifier id = null, st serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The resource ID of the Azure key vault associated with the Batch account. + /// The URL of the Azure key vault associated with the Batch account. + /// A new instance for mocking. + public static BatchKeyVaultReference BatchKeyVaultReference(ResourceIdentifier id = null, Uri uri = null) + { + return new BatchKeyVaultReference(id, uri, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Action when client IP address is matched. + /// IPv4 address, or IPv4 address range in CIDR format. + /// A new instance for mocking. + public static BatchIPRule BatchIPRule(BatchIPRuleAction action = default, string value = null) + { + return new BatchIPRule(action, value, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -159,6 +137,36 @@ public static BatchPrivateLinkServiceConnectionState BatchPrivateLinkServiceConn return new BatchPrivateLinkServiceConnectionState(status, description, actionRequired, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The resource ID of the storage account to be used for auto-storage account. + /// The authentication mode which the Batch service will use to manage the auto-storage account. + /// The identity referenced here must be assigned to pools which have compute nodes that need access to auto-storage. + /// The UTC time at which storage keys were last synchronized with the Batch account. + /// A new instance for mocking. + public static BatchAccountAutoStorageConfiguration BatchAccountAutoStorageConfiguration(ResourceIdentifier storageAccountId = null, BatchAutoStorageAuthenticationMode? authenticationMode = null, ResourceIdentifier nodeIdentityResourceId = null, DateTimeOffset lastKeySyncedOn = default) + { + return new BatchAccountAutoStorageConfiguration(storageAccountId, authenticationMode, nodeIdentityResourceId != null ? new ComputeNodeIdentityReference(nodeIdentityResourceId, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null, lastKeySyncedOn); + } + + /// Initializes a new instance of . + /// The resource ID of the storage account to be used for auto-storage account. + /// The authentication mode which the Batch service will use to manage the auto-storage account. + /// The identity referenced here must be assigned to pools which have compute nodes that need access to auto-storage. + /// A new instance for mocking. + public static BatchAccountAutoStorageBaseConfiguration BatchAccountAutoStorageBaseConfiguration(ResourceIdentifier storageAccountId = null, BatchAutoStorageAuthenticationMode? authenticationMode = null, ResourceIdentifier nodeIdentityResourceId = null) + { + return new BatchAccountAutoStorageBaseConfiguration(storageAccountId, authenticationMode, nodeIdentityResourceId != null ? new ComputeNodeIdentityReference(nodeIdentityResourceId, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Type of the key source. + /// Additional details when using Microsoft.KeyVault. + /// A new instance for mocking. + public static BatchAccountEncryptionConfiguration BatchAccountEncryptionConfiguration(BatchAccountKeySource? keySource = null, Uri keyIdentifier = null) + { + return new BatchAccountEncryptionConfiguration(keySource, keyIdentifier != null ? new KeyVaultProperties(keyIdentifier, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The Virtual Machine family name. /// The core quota for the VM family for the Batch account. @@ -426,7 +434,7 @@ public static BatchPrivateLinkResourceData BatchPrivateLinkResourceData(Resource /// The time at which the pool entered its current state. /// Whether the pool is resizing. /// The time at which the pool entered its current allocation state. - /// For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// Deployment configuration properties. /// The number of dedicated compute nodes currently in the pool. /// The number of Spot/low-priority compute nodes currently in the pool. diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateCollection.cs index 85f3e8ff7a66..3b93d43102e3 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateCollection.cs @@ -15,18 +15,20 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Batch.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBatchAccountCertificates method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBatchAccountCertificates method from an instance of . /// public partial class BatchAccountCertificateCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _batchAccountCertificateCertificateClientDiagnostics; private readonly CertificateRestOperations _batchAccountCertificateCertificateRestClient; + private readonly string _accountName; /// Initializes a new instance of the class for mocking. protected BatchAccountCertificateCollection() @@ -36,8 +38,12 @@ protected BatchAccountCertificateCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BatchAccountCertificateCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal BatchAccountCertificateCollection(ArmClient client, ResourceIdentifier id, string accountName) : base(client, id) { + _accountName = accountName; _batchAccountCertificateCertificateClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", BatchAccountCertificateResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(BatchAccountCertificateResource.ResourceType, out string batchAccountCertificateCertificateApiVersion); _batchAccountCertificateCertificateRestClient = new CertificateRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchAccountCertificateCertificateApiVersion); @@ -48,8 +54,8 @@ internal BatchAccountCertificateCollection(ArmClient client, ResourceIdentifier internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != BatchAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BatchAccountResource.ResourceType), nameof(id)); + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } /// @@ -90,8 +96,8 @@ public virtual async Task> CreateO scope.Start(); try { - var response = await _batchAccountCertificateCertificateRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, content, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var uri = _batchAccountCertificateCertificateRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, content, ifMatch, ifNoneMatch); + var response = await _batchAccountCertificateCertificateRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, content, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var uri = _batchAccountCertificateCertificateRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, content, ifMatch, ifNoneMatch); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BatchArmOperation(Response.FromValue(new BatchAccountCertificateResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -143,8 +149,8 @@ public virtual ArmOperation CreateOrUpdate(Wait scope.Start(); try { - var response = _batchAccountCertificateCertificateRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, content, ifMatch, ifNoneMatch, cancellationToken); - var uri = _batchAccountCertificateCertificateRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, content, ifMatch, ifNoneMatch); + var response = _batchAccountCertificateCertificateRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, content, ifMatch, ifNoneMatch, cancellationToken); + var uri = _batchAccountCertificateCertificateRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, content, ifMatch, ifNoneMatch); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BatchArmOperation(Response.FromValue(new BatchAccountCertificateResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -191,7 +197,7 @@ public virtual async Task> GetAsync(st scope.Start(); try { - var response = await _batchAccountCertificateCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken).ConfigureAwait(false); + var response = await _batchAccountCertificateCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchAccountCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -236,7 +242,7 @@ public virtual Response Get(string certificateN scope.Start(); try { - var response = _batchAccountCertificateCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken); + var response = _batchAccountCertificateCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchAccountCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -276,8 +282,8 @@ public virtual Response Get(string certificateN /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(int? maxresults = null, string select = null, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchAccountCertificateResource(Client, BatchAccountCertificateData.DeserializeBatchAccountCertificateData(e)), _batchAccountCertificateCertificateClientDiagnostics, Pipeline, "BatchAccountCertificateCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -309,8 +315,8 @@ public virtual AsyncPageable GetAllAsync(int? m /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(int? maxresults = null, string select = null, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountCertificateCertificateRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchAccountCertificateResource(Client, BatchAccountCertificateData.DeserializeBatchAccountCertificateData(e)), _batchAccountCertificateCertificateClientDiagnostics, Pipeline, "BatchAccountCertificateCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -347,7 +353,7 @@ public virtual async Task> ExistsAsync(string certificateName, Ca scope.Start(); try { - var response = await _batchAccountCertificateCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchAccountCertificateCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -390,7 +396,7 @@ public virtual Response Exists(string certificateName, CancellationToken c scope.Start(); try { - var response = _batchAccountCertificateCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); + var response = _batchAccountCertificateCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -433,7 +439,7 @@ public virtual async Task> Get scope.Start(); try { - var response = await _batchAccountCertificateCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchAccountCertificateCertificateRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchAccountCertificateResource(Client, response.Value), response.GetRawResponse()); @@ -478,7 +484,7 @@ public virtual NullableResponse GetIfExists(str scope.Start(); try { - var response = _batchAccountCertificateCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, certificateName, cancellationToken: cancellationToken); + var response = _batchAccountCertificateCertificateRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, certificateName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchAccountCertificateResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateResource.cs index 493a37394a69..d5a8335f746c 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCertificateResource.cs @@ -13,6 +13,7 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Batch.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { @@ -20,7 +21,7 @@ namespace Azure.ResourceManager.Batch /// A Class representing a BatchAccountCertificate along with the instance operations that can be performed on it. /// If you have a you can construct a /// from an instance of using the GetBatchAccountCertificateResource method. - /// Otherwise you can get one from its parent resource using the GetBatchAccountCertificate method. + /// Otherwise you can get one from its parent resource using the GetBatchAccountCertificate method. /// public partial class BatchAccountCertificateResource : ArmResource { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCollection.cs deleted file mode 100644 index fbbc6faf2fe8..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountCollection.cs +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Batch.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.Batch -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBatchAccounts method from an instance of . - /// - public partial class BatchAccountCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _batchAccountClientDiagnostics; - private readonly BatchAccountRestOperations _batchAccountRestClient; - - /// Initializes a new instance of the class for mocking. - protected BatchAccountCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal BatchAccountCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _batchAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", BatchAccountResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(BatchAccountResource.ResourceType, out string batchAccountApiVersion); - _batchAccountRestClient = new BatchAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchAccountApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Create - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. - /// Additional parameters for account creation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string accountName, BatchAccountCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, content, cancellationToken).ConfigureAwait(false); - var operation = new BatchArmOperation(new BatchAccountOperationSource(Client), _batchAccountClientDiagnostics, Pipeline, _batchAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, accountName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Create - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. - /// Additional parameters for account creation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string accountName, BatchAccountCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _batchAccountRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, accountName, content, cancellationToken); - var operation = new BatchArmOperation(new BatchAccountOperationSource(Client), _batchAccountClientDiagnostics, Pipeline, _batchAccountRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, accountName, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about the specified Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Batch account. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.Get"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about the specified Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Batch account. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.Get"); - scope.Start(); - try - { - var response = _batchAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about the Batch accounts associated with the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts - /// - /// - /// Operation Id - /// BatchAccount_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), _batchAccountClientDiagnostics, Pipeline, "BatchAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets information about the Batch accounts associated with the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts - /// - /// - /// Operation Id - /// BatchAccount_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), _batchAccountClientDiagnostics, Pipeline, "BatchAccountCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Batch account. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.Exists"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Batch account. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.Exists"); - scope.Start(); - try - { - var response = _batchAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Batch account. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Batch account. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountCollection.GetIfExists"); - scope.Start(); - try - { - var response = _batchAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, accountName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorCollection.cs index 7960c454da45..313fc4f1165a 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorCollection.cs @@ -14,18 +14,20 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBatchAccountDetectors method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBatchAccountDetectors method from an instance of . /// public partial class BatchAccountDetectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _batchAccountDetectorBatchAccountClientDiagnostics; private readonly BatchAccountRestOperations _batchAccountDetectorBatchAccountRestClient; + private readonly string _accountName; /// Initializes a new instance of the class for mocking. protected BatchAccountDetectorCollection() @@ -35,8 +37,12 @@ protected BatchAccountDetectorCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BatchAccountDetectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal BatchAccountDetectorCollection(ArmClient client, ResourceIdentifier id, string accountName) : base(client, id) { + _accountName = accountName; _batchAccountDetectorBatchAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", BatchAccountDetectorResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(BatchAccountDetectorResource.ResourceType, out string batchAccountDetectorBatchAccountApiVersion); _batchAccountDetectorBatchAccountRestClient = new BatchAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchAccountDetectorBatchAccountApiVersion); @@ -47,8 +53,8 @@ internal BatchAccountDetectorCollection(ArmClient client, ResourceIdentifier id) internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != BatchAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BatchAccountResource.ResourceType), nameof(id)); + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } /// @@ -84,7 +90,7 @@ public virtual async Task> GetAsync(strin scope.Start(); try { - var response = await _batchAccountDetectorBatchAccountRestClient.GetDetectorAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, detectorId, cancellationToken).ConfigureAwait(false); + var response = await _batchAccountDetectorBatchAccountRestClient.GetDetectorAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, detectorId, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchAccountDetectorResource(Client, response.Value), response.GetRawResponse()); @@ -129,7 +135,7 @@ public virtual Response Get(string detectorId, Can scope.Start(); try { - var response = _batchAccountDetectorBatchAccountRestClient.GetDetector(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, detectorId, cancellationToken); + var response = _batchAccountDetectorBatchAccountRestClient.GetDetector(Id.SubscriptionId, Id.ResourceGroupName, _accountName, detectorId, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchAccountDetectorResource(Client, response.Value), response.GetRawResponse()); @@ -166,8 +172,8 @@ public virtual Response Get(string detectorId, Can /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchAccountDetectorResource(Client, BatchAccountDetectorData.DeserializeBatchAccountDetectorData(e)), _batchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "BatchAccountDetectorCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -196,8 +202,8 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountDetectorBatchAccountRestClient.CreateListDetectorsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchAccountDetectorResource(Client, BatchAccountDetectorData.DeserializeBatchAccountDetectorData(e)), _batchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "BatchAccountDetectorCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -234,7 +240,7 @@ public virtual async Task> ExistsAsync(string detectorId, Cancell scope.Start(); try { - var response = await _batchAccountDetectorBatchAccountRestClient.GetDetectorAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, detectorId, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchAccountDetectorBatchAccountRestClient.GetDetectorAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, detectorId, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -277,7 +283,7 @@ public virtual Response Exists(string detectorId, CancellationToken cancel scope.Start(); try { - var response = _batchAccountDetectorBatchAccountRestClient.GetDetector(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, detectorId, cancellationToken: cancellationToken); + var response = _batchAccountDetectorBatchAccountRestClient.GetDetector(Id.SubscriptionId, Id.ResourceGroupName, _accountName, detectorId, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -320,7 +326,7 @@ public virtual async Task> GetIfE scope.Start(); try { - var response = await _batchAccountDetectorBatchAccountRestClient.GetDetectorAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, detectorId, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchAccountDetectorBatchAccountRestClient.GetDetectorAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, detectorId, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchAccountDetectorResource(Client, response.Value), response.GetRawResponse()); @@ -365,7 +371,7 @@ public virtual NullableResponse GetIfExists(string scope.Start(); try { - var response = _batchAccountDetectorBatchAccountRestClient.GetDetector(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, detectorId, cancellationToken: cancellationToken); + var response = _batchAccountDetectorBatchAccountRestClient.GetDetector(Id.SubscriptionId, Id.ResourceGroupName, _accountName, detectorId, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchAccountDetectorResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorResource.cs index d4832df1ec45..5eedb630f523 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountDetectorResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { @@ -18,7 +19,7 @@ namespace Azure.ResourceManager.Batch /// A Class representing a BatchAccountDetector along with the instance operations that can be performed on it. /// If you have a you can construct a /// from an instance of using the GetBatchAccountDetectorResource method. - /// Otherwise you can get one from its parent resource using the GetBatchAccountDetector method. + /// Otherwise you can get one from its parent resource using the GetBatchAccountDetector method. /// public partial class BatchAccountDetectorResource : ArmResource { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolCollection.cs index 0ec96fbb2f5f..d76e5d0c19ef 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolCollection.cs @@ -14,18 +14,20 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBatchAccountPools method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBatchAccountPools method from an instance of . /// public partial class BatchAccountPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _batchAccountPoolPoolClientDiagnostics; private readonly PoolRestOperations _batchAccountPoolPoolRestClient; + private readonly string _accountName; /// Initializes a new instance of the class for mocking. protected BatchAccountPoolCollection() @@ -35,8 +37,12 @@ protected BatchAccountPoolCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BatchAccountPoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal BatchAccountPoolCollection(ArmClient client, ResourceIdentifier id, string accountName) : base(client, id) { + _accountName = accountName; _batchAccountPoolPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", BatchAccountPoolResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(BatchAccountPoolResource.ResourceType, out string batchAccountPoolPoolApiVersion); _batchAccountPoolPoolRestClient = new PoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchAccountPoolPoolApiVersion); @@ -47,8 +53,8 @@ internal BatchAccountPoolCollection(ArmClient client, ResourceIdentifier id) : b internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != BatchAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BatchAccountResource.ResourceType), nameof(id)); + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } /// @@ -89,8 +95,8 @@ public virtual async Task> CreateOrUpdate scope.Start(); try { - var response = await _batchAccountPoolPoolRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var uri = _batchAccountPoolPoolRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, data, ifMatch, ifNoneMatch); + var response = await _batchAccountPoolPoolRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var uri = _batchAccountPoolPoolRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, data, ifMatch, ifNoneMatch); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BatchArmOperation(Response.FromValue(new BatchAccountPoolResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -142,8 +148,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w scope.Start(); try { - var response = _batchAccountPoolPoolRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, data, ifMatch, ifNoneMatch, cancellationToken); - var uri = _batchAccountPoolPoolRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, data, ifMatch, ifNoneMatch); + var response = _batchAccountPoolPoolRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, data, ifMatch, ifNoneMatch, cancellationToken); + var uri = _batchAccountPoolPoolRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, data, ifMatch, ifNoneMatch); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BatchArmOperation(Response.FromValue(new BatchAccountPoolResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -190,7 +196,7 @@ public virtual async Task> GetAsync(string po scope.Start(); try { - var response = await _batchAccountPoolPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, cancellationToken).ConfigureAwait(false); + var response = await _batchAccountPoolPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchAccountPoolResource(Client, response.Value), response.GetRawResponse()); @@ -235,7 +241,7 @@ public virtual Response Get(string poolName, Cancellat scope.Start(); try { - var response = _batchAccountPoolPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, cancellationToken); + var response = _batchAccountPoolPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchAccountPoolResource(Client, response.Value), response.GetRawResponse()); @@ -289,8 +295,8 @@ public virtual Response Get(string poolName, Cancellat /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(int? maxresults = null, string select = null, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchAccountPoolResource(Client, BatchAccountPoolData.DeserializeBatchAccountPoolData(e)), _batchAccountPoolPoolClientDiagnostics, Pipeline, "BatchAccountPoolCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -336,8 +342,8 @@ public virtual AsyncPageable GetAllAsync(int? maxresul /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(int? maxresults = null, string select = null, string filter = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults, select, filter); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountPoolPoolRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults, select, filter); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchAccountPoolResource(Client, BatchAccountPoolData.DeserializeBatchAccountPoolData(e)), _batchAccountPoolPoolClientDiagnostics, Pipeline, "BatchAccountPoolCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -374,7 +380,7 @@ public virtual async Task> ExistsAsync(string poolName, Cancellat scope.Start(); try { - var response = await _batchAccountPoolPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchAccountPoolPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -417,7 +423,7 @@ public virtual Response Exists(string poolName, CancellationToken cancella scope.Start(); try { - var response = _batchAccountPoolPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, cancellationToken: cancellationToken); + var response = _batchAccountPoolPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -460,7 +466,7 @@ public virtual async Task> GetIfExist scope.Start(); try { - var response = await _batchAccountPoolPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchAccountPoolPoolRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchAccountPoolResource(Client, response.Value), response.GetRawResponse()); @@ -505,7 +511,7 @@ public virtual NullableResponse GetIfExists(string poo scope.Start(); try { - var response = _batchAccountPoolPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, poolName, cancellationToken: cancellationToken); + var response = _batchAccountPoolPoolRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, poolName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchAccountPoolResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs index bf9d11430eb6..08769d5f2a48 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolData.cs @@ -77,7 +77,7 @@ public BatchAccountPoolData() /// The time at which the pool entered its current state. /// Whether the pool is resizing. /// The time at which the pool entered its current allocation state. - /// For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). /// Deployment configuration properties. /// The number of dedicated compute nodes currently in the pool. /// The number of Spot/low-priority compute nodes currently in the pool. @@ -159,7 +159,7 @@ internal BatchAccountPoolData(ResourceIdentifier id, string name, ResourceType r public BatchAccountPoolAllocationState? AllocationState { get; } /// The time at which the pool entered its current allocation state. public DateTimeOffset? AllocationStateTransitionOn { get; } - /// For information about available VM sizes, see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). + /// For information about available VM sizes, see Sizes for Virtual Machines in Azure (https://learn.microsoft.com/azure/virtual-machines/sizes/overview). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series). public string VmSize { get; set; } /// The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure. public BatchVmConfiguration DeploymentVmConfiguration diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolResource.cs index 488e303e82cd..d00990cbe062 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountPoolResource.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { @@ -19,7 +20,7 @@ namespace Azure.ResourceManager.Batch /// A Class representing a BatchAccountPool along with the instance operations that can be performed on it. /// If you have a you can construct a /// from an instance of using the GetBatchAccountPoolResource method. - /// Otherwise you can get one from its parent resource using the GetBatchAccountPool method. + /// Otherwise you can get one from its parent resource using the GetBatchAccountPool method. /// public partial class BatchAccountPoolResource : ArmResource { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.Serialization.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.Serialization.cs deleted file mode 100644 index 3a8369378eab..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.Batch -{ - public partial class BatchAccountResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - BatchAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - BatchAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs deleted file mode 100644 index 2c45397ad1ad..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountResource.cs +++ /dev/null @@ -1,1120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Batch.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.Batch -{ - /// - /// A Class representing a BatchAccount along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetBatchAccountResource method. - /// Otherwise you can get one from its parent resource using the GetBatchAccount method. - /// - public partial class BatchAccountResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The accountName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string accountName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _batchAccountClientDiagnostics; - private readonly BatchAccountRestOperations _batchAccountRestClient; - private readonly BatchAccountData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Batch/batchAccounts"; - - /// Initializes a new instance of the class for mocking. - protected BatchAccountResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal BatchAccountResource(ArmClient client, BatchAccountData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal BatchAccountResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _batchAccountClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string batchAccountApiVersion); - _batchAccountRestClient = new BatchAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchAccountApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual BatchAccountData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of BatchAccountDetectorResources in the BatchAccount. - /// An object representing collection of BatchAccountDetectorResources and their operations over a BatchAccountDetectorResource. - public virtual BatchAccountDetectorCollection GetBatchAccountDetectors() - { - return GetCachedClient(client => new BatchAccountDetectorCollection(client, Id)); - } - - /// - /// Gets information about the given detector for a given Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId} - /// - /// - /// Operation Id - /// BatchAccount_GetDetector - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the detector. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetBatchAccountDetectorAsync(string detectorId, CancellationToken cancellationToken = default) - { - return await GetBatchAccountDetectors().GetAsync(detectorId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the given detector for a given Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId} - /// - /// - /// Operation Id - /// BatchAccount_GetDetector - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the detector. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetBatchAccountDetector(string detectorId, CancellationToken cancellationToken = default) - { - return GetBatchAccountDetectors().Get(detectorId, cancellationToken); - } - - /// Gets a collection of BatchApplicationResources in the BatchAccount. - /// An object representing collection of BatchApplicationResources and their operations over a BatchApplicationResource. - public virtual BatchApplicationCollection GetBatchApplications() - { - return GetCachedClient(client => new BatchApplicationCollection(client, Id)); - } - - /// - /// Gets information about the specified application. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the application. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetBatchApplicationAsync(string applicationName, CancellationToken cancellationToken = default) - { - return await GetBatchApplications().GetAsync(applicationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the specified application. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the application. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetBatchApplication(string applicationName, CancellationToken cancellationToken = default) - { - return GetBatchApplications().Get(applicationName, cancellationToken); - } - - /// Gets a collection of BatchAccountCertificateResources in the BatchAccount. - /// An object representing collection of BatchAccountCertificateResources and their operations over a BatchAccountCertificateResource. - public virtual BatchAccountCertificateCollection GetBatchAccountCertificates() - { - return GetCachedClient(client => new BatchAccountCertificateCollection(client, Id)); - } - - /// - /// Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName} - /// - /// - /// Operation Id - /// Certificate_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetBatchAccountCertificateAsync(string certificateName, CancellationToken cancellationToken = default) - { - return await GetBatchAccountCertificates().GetAsync(certificateName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName} - /// - /// - /// Operation Id - /// Certificate_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetBatchAccountCertificate(string certificateName, CancellationToken cancellationToken = default) - { - return GetBatchAccountCertificates().Get(certificateName, cancellationToken); - } - - /// Gets a collection of BatchPrivateLinkResources in the BatchAccount. - /// An object representing collection of BatchPrivateLinkResources and their operations over a BatchPrivateLinkResource. - public virtual BatchPrivateLinkResourceCollection GetBatchPrivateLinkResources() - { - return GetCachedClient(client => new BatchPrivateLinkResourceCollection(client, Id)); - } - - /// - /// Gets information about the specified private link resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName} - /// - /// - /// Operation Id - /// PrivateLinkResource_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The private link resource name. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetBatchPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) - { - return await GetBatchPrivateLinkResources().GetAsync(privateLinkResourceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the specified private link resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName} - /// - /// - /// Operation Id - /// PrivateLinkResource_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The private link resource name. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetBatchPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) - { - return GetBatchPrivateLinkResources().Get(privateLinkResourceName, cancellationToken); - } - - /// Gets a collection of BatchPrivateEndpointConnectionResources in the BatchAccount. - /// An object representing collection of BatchPrivateEndpointConnectionResources and their operations over a BatchPrivateEndpointConnectionResource. - public virtual BatchPrivateEndpointConnectionCollection GetBatchPrivateEndpointConnections() - { - return GetCachedClient(client => new BatchPrivateEndpointConnectionCollection(client, Id)); - } - - /// - /// Gets information about the specified private endpoint connection. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The private endpoint connection name. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetBatchPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - return await GetBatchPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the specified private endpoint connection. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The private endpoint connection name. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetBatchPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) - { - return GetBatchPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); - } - - /// Gets a collection of BatchAccountPoolResources in the BatchAccount. - /// An object representing collection of BatchAccountPoolResources and their operations over a BatchAccountPoolResource. - public virtual BatchAccountPoolCollection GetBatchAccountPools() - { - return GetCachedClient(client => new BatchAccountPoolCollection(client, Id)); - } - - /// - /// Gets information about the specified pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName} - /// - /// - /// Operation Id - /// Pool_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The pool name. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetBatchAccountPoolAsync(string poolName, CancellationToken cancellationToken = default) - { - return await GetBatchAccountPools().GetAsync(poolName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the specified pool. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName} - /// - /// - /// Operation Id - /// Pool_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The pool name. This must be unique within the account. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetBatchAccountPool(string poolName, CancellationToken cancellationToken = default) - { - return GetBatchAccountPools().Get(poolName, cancellationToken); - } - - /// Gets a collection of NetworkSecurityPerimeterConfigurationResources in the BatchAccount. - /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. - public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations() - { - return GetCachedClient(client => new NetworkSecurityPerimeterConfigurationCollection(client, Id)); - } - - /// - /// Gets information about the specified NSP configuration. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeter_GetConfiguration - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetNetworkSecurityPerimeterConfigurationAsync(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return await GetNetworkSecurityPerimeterConfigurations().GetAsync(networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets information about the specified NSP configuration. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} - /// - /// - /// Operation Id - /// NetworkSecurityPerimeter_GetConfiguration - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The name for Network Security Perimeter configuration. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetNetworkSecurityPerimeterConfiguration(string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) - { - return GetNetworkSecurityPerimeterConfigurations().Get(networkSecurityPerimeterConfigurationName, cancellationToken); - } - - /// - /// Gets information about the specified Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.Get"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets information about the specified Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Get - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.Get"); - scope.Start(); - try - { - var response = _batchAccountRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes the specified Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Delete - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.Delete"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new BatchArmOperation(_batchAccountClientDiagnostics, Pipeline, _batchAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes the specified Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Delete - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.Delete"); - scope.Start(); - try - { - var response = _batchAccountRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new BatchArmOperation(_batchAccountClientDiagnostics, Pipeline, _batchAccountRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Update - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Additional parameters for account update. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(BatchAccountPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.Update"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the properties of an existing Batch account. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} - /// - /// - /// Operation Id - /// BatchAccount_Update - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Additional parameters for account update. - /// The cancellation token to use. - /// is null. - public virtual Response Update(BatchAccountPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.Update"); - scope.Start(); - try - { - var response = _batchAccountRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new BatchAccountResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys - /// - /// - /// Operation Id - /// BatchAccount_SynchronizeAutoStorageKeys - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task SynchronizeAutoStorageKeysAsync(CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.SynchronizeAutoStorageKeys"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.SynchronizeAutoStorageKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys - /// - /// - /// Operation Id - /// BatchAccount_SynchronizeAutoStorageKeys - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response SynchronizeAutoStorageKeys(CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.SynchronizeAutoStorageKeys"); - scope.Start(); - try - { - var response = _batchAccountRestClient.SynchronizeAutoStorageKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys - /// - /// - /// Operation Id - /// BatchAccount_RegenerateKey - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The type of key to regenerate. - /// The cancellation token to use. - /// is null. - public virtual async Task> RegenerateKeyAsync(BatchAccountRegenerateKeyContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.RegenerateKey"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.RegenerateKeyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys - /// - /// - /// Operation Id - /// BatchAccount_RegenerateKey - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The type of key to regenerate. - /// The cancellation token to use. - /// is null. - public virtual Response RegenerateKey(BatchAccountRegenerateKeyContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.RegenerateKey"); - scope.Start(); - try - { - var response = _batchAccountRestClient.RegenerateKey(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys - /// - /// - /// Operation Id - /// BatchAccount_GetKeys - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetKeysAsync(CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.GetKeys"); - scope.Start(); - try - { - var response = await _batchAccountRestClient.GetKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys - /// - /// - /// Operation Id - /// BatchAccount_GetKeys - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetKeys(CancellationToken cancellationToken = default) - { - using var scope = _batchAccountClientDiagnostics.CreateScope("BatchAccountResource.GetKeys"); - scope.Start(); - try - { - var response = _batchAccountRestClient.GetKeys(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints - /// - /// - /// Operation Id - /// BatchAccount_ListOutboundNetworkDependenciesEndpoints - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetOutboundNetworkDependenciesEndpointsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BatchAccountOutboundEnvironmentEndpoint.DeserializeBatchAccountOutboundEnvironmentEndpoint(e), _batchAccountClientDiagnostics, Pipeline, "BatchAccountResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); - } - - /// - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints - /// - /// - /// Operation Id - /// BatchAccount_ListOutboundNetworkDependenciesEndpoints - /// - /// - /// Default Api Version - /// 2024-07-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetOutboundNetworkDependenciesEndpoints(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BatchAccountOutboundEnvironmentEndpoint.DeserializeBatchAccountOutboundEnvironmentEndpoint(e), _batchAccountClientDiagnostics, Pipeline, "BatchAccountResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationCollection.cs index e38c067942f4..729850e57787 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationCollection.cs @@ -14,18 +14,20 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBatchApplications method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBatchApplications method from an instance of . /// public partial class BatchApplicationCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _batchApplicationApplicationClientDiagnostics; private readonly ApplicationRestOperations _batchApplicationApplicationRestClient; + private readonly string _accountName; /// Initializes a new instance of the class for mocking. protected BatchApplicationCollection() @@ -35,8 +37,12 @@ protected BatchApplicationCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BatchApplicationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal BatchApplicationCollection(ArmClient client, ResourceIdentifier id, string accountName) : base(client, id) { + _accountName = accountName; _batchApplicationApplicationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", BatchApplicationResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(BatchApplicationResource.ResourceType, out string batchApplicationApplicationApiVersion); _batchApplicationApplicationRestClient = new ApplicationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchApplicationApplicationApiVersion); @@ -47,8 +53,8 @@ internal BatchApplicationCollection(ArmClient client, ResourceIdentifier id) : b internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != BatchAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BatchAccountResource.ResourceType), nameof(id)); + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } /// @@ -87,8 +93,8 @@ public virtual async Task> CreateOrUpdate scope.Start(); try { - var response = await _batchApplicationApplicationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, data, cancellationToken).ConfigureAwait(false); - var uri = _batchApplicationApplicationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, data); + var response = await _batchApplicationApplicationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, data, cancellationToken).ConfigureAwait(false); + var uri = _batchApplicationApplicationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BatchArmOperation(Response.FromValue(new BatchApplicationResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -138,8 +144,8 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w scope.Start(); try { - var response = _batchApplicationApplicationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, data, cancellationToken); - var uri = _batchApplicationApplicationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, data); + var response = _batchApplicationApplicationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, data, cancellationToken); + var uri = _batchApplicationApplicationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new BatchArmOperation(Response.FromValue(new BatchApplicationResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -186,7 +192,7 @@ public virtual async Task> GetAsync(string ap scope.Start(); try { - var response = await _batchApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, cancellationToken).ConfigureAwait(false); + var response = await _batchApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchApplicationResource(Client, response.Value), response.GetRawResponse()); @@ -231,7 +237,7 @@ public virtual Response Get(string applicationName, Ca scope.Start(); try { - var response = _batchApplicationApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, cancellationToken); + var response = _batchApplicationApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchApplicationResource(Client, response.Value), response.GetRawResponse()); @@ -269,8 +275,8 @@ public virtual Response Get(string applicationName, Ca /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(int? maxresults = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchApplicationApplicationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchApplicationApplicationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchApplicationApplicationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchApplicationApplicationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchApplicationResource(Client, BatchApplicationData.DeserializeBatchApplicationData(e)), _batchApplicationApplicationClientDiagnostics, Pipeline, "BatchApplicationCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -300,8 +306,8 @@ public virtual AsyncPageable GetAllAsync(int? maxresul /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(int? maxresults = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchApplicationApplicationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchApplicationApplicationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchApplicationApplicationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchApplicationApplicationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchApplicationResource(Client, BatchApplicationData.DeserializeBatchApplicationData(e)), _batchApplicationApplicationClientDiagnostics, Pipeline, "BatchApplicationCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -338,7 +344,7 @@ public virtual async Task> ExistsAsync(string applicationName, Ca scope.Start(); try { - var response = await _batchApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -381,7 +387,7 @@ public virtual Response Exists(string applicationName, CancellationToken c scope.Start(); try { - var response = _batchApplicationApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, cancellationToken: cancellationToken); + var response = _batchApplicationApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -424,7 +430,7 @@ public virtual async Task> GetIfExist scope.Start(); try { - var response = await _batchApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchApplicationResource(Client, response.Value), response.GetRawResponse()); @@ -469,7 +475,7 @@ public virtual NullableResponse GetIfExists(string app scope.Start(); try { - var response = _batchApplicationApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationName, cancellationToken: cancellationToken); + var response = _batchApplicationApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, applicationName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchApplicationResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs index 845411f40c64..43db589f47ca 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchApplicationResource.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { @@ -19,7 +20,7 @@ namespace Azure.ResourceManager.Batch /// A Class representing a BatchApplication along with the instance operations that can be performed on it. /// If you have a you can construct a /// from an instance of using the GetBatchApplicationResource method. - /// Otherwise you can get one from its parent resource using the GetBatchApplication method. + /// Otherwise you can get one from its parent resource using the GetBatchApplication method. /// public partial class BatchApplicationResource : ArmResource { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionCollection.cs index f68117ab3742..74436c3804e0 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionCollection.cs @@ -14,18 +14,20 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBatchPrivateEndpointConnections method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBatchPrivateEndpointConnections method from an instance of . /// public partial class BatchPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _batchPrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics; private readonly PrivateEndpointConnectionRestOperations _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient; + private readonly string _accountName; /// Initializes a new instance of the class for mocking. protected BatchPrivateEndpointConnectionCollection() @@ -35,8 +37,12 @@ protected BatchPrivateEndpointConnectionCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BatchPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal BatchPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id, string accountName) : base(client, id) { + _accountName = accountName; _batchPrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", BatchPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(BatchPrivateEndpointConnectionResource.ResourceType, out string batchPrivateEndpointConnectionPrivateEndpointConnectionApiVersion); _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient = new PrivateEndpointConnectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchPrivateEndpointConnectionPrivateEndpointConnectionApiVersion); @@ -47,8 +53,8 @@ internal BatchPrivateEndpointConnectionCollection(ArmClient client, ResourceIden internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != BatchAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BatchAccountResource.ResourceType), nameof(id)); + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } /// @@ -84,7 +90,7 @@ public virtual async Task> GetA scope.Start(); try { - var response = await _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + var response = await _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -129,7 +135,7 @@ public virtual Response Get(string priva scope.Start(); try { - var response = _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + var response = _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateEndpointConnectionName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -167,8 +173,8 @@ public virtual Response Get(string priva /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(int? maxresults = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchPrivateEndpointConnectionResource(Client, BatchPrivateEndpointConnectionData.DeserializeBatchPrivateEndpointConnectionData(e)), _batchPrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics, Pipeline, "BatchPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -198,8 +204,8 @@ public virtual AsyncPageable GetAllAsync /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(int? maxresults = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchPrivateEndpointConnectionResource(Client, BatchPrivateEndpointConnectionData.DeserializeBatchPrivateEndpointConnectionData(e)), _batchPrivateEndpointConnectionPrivateEndpointConnectionClientDiagnostics, Pipeline, "BatchPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -236,7 +242,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn scope.Start(); try { - var response = await _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -279,7 +285,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance scope.Start(); try { - var response = _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + var response = _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateEndpointConnectionName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -322,7 +328,7 @@ public virtual async Task(response.GetRawResponse()); return Response.FromValue(new BatchPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -367,7 +373,7 @@ public virtual NullableResponse GetIfExi scope.Start(); try { - var response = _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + var response = _batchPrivateEndpointConnectionPrivateEndpointConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateEndpointConnectionName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionResource.cs index 9d13dbd7c646..ca51a39f85dc 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateEndpointConnectionResource.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { @@ -19,7 +20,7 @@ namespace Azure.ResourceManager.Batch /// A Class representing a BatchPrivateEndpointConnection along with the instance operations that can be performed on it. /// If you have a you can construct a /// from an instance of using the GetBatchPrivateEndpointConnectionResource method. - /// Otherwise you can get one from its parent resource using the GetBatchPrivateEndpointConnection method. + /// Otherwise you can get one from its parent resource using the GetBatchPrivateEndpointConnection method. /// public partial class BatchPrivateEndpointConnectionResource : ArmResource { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResource.cs index 97b633751826..3a5bea94268a 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { @@ -18,7 +19,7 @@ namespace Azure.ResourceManager.Batch /// A Class representing a BatchPrivateLinkResource along with the instance operations that can be performed on it. /// If you have a you can construct a /// from an instance of using the GetBatchPrivateLinkResource method. - /// Otherwise you can get one from its parent resource using the GetBatchPrivateLinkResource method. + /// Otherwise you can get one from its parent resource using the GetBatchPrivateLinkResource method. /// public partial class BatchPrivateLinkResource : ArmResource { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResourceCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResourceCollection.cs index 5530adc5f5d8..64ae64f71135 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResourceCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchPrivateLinkResourceCollection.cs @@ -14,18 +14,20 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetBatchPrivateLinkResources method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetBatchPrivateLinkResources method from an instance of . /// public partial class BatchPrivateLinkResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _batchPrivateLinkResourcePrivateLinkResourceClientDiagnostics; private readonly PrivateLinkResourceRestOperations _batchPrivateLinkResourcePrivateLinkResourceRestClient; + private readonly string _accountName; /// Initializes a new instance of the class for mocking. protected BatchPrivateLinkResourceCollection() @@ -35,8 +37,12 @@ protected BatchPrivateLinkResourceCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal BatchPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal BatchPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id, string accountName) : base(client, id) { + _accountName = accountName; _batchPrivateLinkResourcePrivateLinkResourceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", BatchPrivateLinkResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(BatchPrivateLinkResource.ResourceType, out string batchPrivateLinkResourcePrivateLinkResourceApiVersion); _batchPrivateLinkResourcePrivateLinkResourceRestClient = new PrivateLinkResourceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, batchPrivateLinkResourcePrivateLinkResourceApiVersion); @@ -47,8 +53,8 @@ internal BatchPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != BatchAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BatchAccountResource.ResourceType), nameof(id)); + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } /// @@ -84,7 +90,7 @@ public virtual async Task> GetAsync(string pr scope.Start(); try { - var response = await _batchPrivateLinkResourcePrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken).ConfigureAwait(false); + var response = await _batchPrivateLinkResourcePrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateLinkResourceName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchPrivateLinkResource(Client, response.Value), response.GetRawResponse()); @@ -129,7 +135,7 @@ public virtual Response Get(string privateLinkResource scope.Start(); try { - var response = _batchPrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken); + var response = _batchPrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateLinkResourceName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new BatchPrivateLinkResource(Client, response.Value), response.GetRawResponse()); @@ -167,8 +173,8 @@ public virtual Response Get(string privateLinkResource /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(int? maxresults = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchPrivateLinkResource(Client, BatchPrivateLinkResourceData.DeserializeBatchPrivateLinkResourceData(e)), _batchPrivateLinkResourcePrivateLinkResourceClientDiagnostics, Pipeline, "BatchPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -198,8 +204,8 @@ public virtual AsyncPageable GetAllAsync(int? maxresul /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(int? maxresults = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, maxresults); + HttpMessage FirstPageRequest(int? pageSizeHint) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _batchPrivateLinkResourcePrivateLinkResourceRestClient.CreateListByBatchAccountNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName, maxresults); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchPrivateLinkResource(Client, BatchPrivateLinkResourceData.DeserializeBatchPrivateLinkResourceData(e)), _batchPrivateLinkResourcePrivateLinkResourceClientDiagnostics, Pipeline, "BatchPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -236,7 +242,7 @@ public virtual async Task> ExistsAsync(string privateLinkResource scope.Start(); try { - var response = await _batchPrivateLinkResourcePrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchPrivateLinkResourcePrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -279,7 +285,7 @@ public virtual Response Exists(string privateLinkResourceName, Cancellatio scope.Start(); try { - var response = _batchPrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + var response = _batchPrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateLinkResourceName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -322,7 +328,7 @@ public virtual async Task> GetIfExist scope.Start(); try { - var response = await _batchPrivateLinkResourcePrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _batchPrivateLinkResourcePrivateLinkResourceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchPrivateLinkResource(Client, response.Value), response.GetRawResponse()); @@ -367,7 +373,7 @@ public virtual NullableResponse GetIfExists(string pri scope.Start(); try { - var response = _batchPrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + var response = _batchPrivateLinkResourcePrivateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _accountName, privateLinkResourceName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new BatchPrivateLinkResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs index 986d8a0b545d..6cd2cdd87632 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/BatchExtensions.cs @@ -33,25 +33,6 @@ private static MockableBatchSubscriptionResource GetMockableBatchSubscriptionRes return resource.GetCachedClient(client => new MockableBatchSubscriptionResource(client, resource.Id)); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static BatchAccountResource GetBatchAccountResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableBatchArmClient(client).GetBatchAccountResource(id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -205,32 +186,170 @@ public static NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPe } /// - /// Gets a collection of BatchAccountResources in the ResourceGroupResource. + /// Gets a collection of BatchAccountDetectorResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// is null. - /// An object representing collection of BatchAccountResources and their operations over a BatchAccountResource. - public static BatchAccountCollection GetBatchAccounts(this ResourceGroupResource resourceGroupResource) + /// The name of the Batch account. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchAccountDetectorResources and their operations over a BatchAccountDetectorResource. + public static BatchAccountDetectorCollection GetBatchAccountDetectors(this ResourceGroupResource resourceGroupResource, string accountName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountDetectors(accountName); + } + + /// + /// Gets information about the given detector for a given Batch account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId} + /// + /// + /// Operation Id + /// BatchAccount_GetDetector + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The name of the detector. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetBatchAccountDetectorAsync(this ResourceGroupResource resourceGroupResource, string accountName, string detectorId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountDetectorAsync(accountName, detectorId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the given detector for a given Batch account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId} + /// + /// + /// Operation Id + /// BatchAccount_GetDetector + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The name of the detector. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetBatchAccountDetector(this ResourceGroupResource resourceGroupResource, string accountName, string detectorId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountDetector(accountName, detectorId, cancellationToken); + } + + /// + /// Gets a collection of BatchApplicationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchApplicationResources and their operations over a BatchApplicationResource. + public static BatchApplicationCollection GetBatchApplications(this ResourceGroupResource resourceGroupResource, string accountName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchApplications(accountName); + } + + /// + /// Gets information about the specified application. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName} + /// + /// + /// Operation Id + /// Application_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The name of the application. This must be unique within the account. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetBatchApplicationAsync(this ResourceGroupResource resourceGroupResource, string accountName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccounts(); + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchApplicationAsync(accountName, applicationName, cancellationToken).ConfigureAwait(false); } /// - /// Gets information about the specified Batch account. + /// Gets information about the specified application. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName} /// /// /// Operation Id - /// BatchAccount_Get + /// Application_Get /// /// /// Default Api Version @@ -238,37 +357,96 @@ public static BatchAccountCollection GetBatchAccounts(this ResourceGroupResource /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The name of the Batch account. + /// The name of the application. This must be unique within the account. /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetBatchApplication(this ResourceGroupResource resourceGroupResource, string accountName, string applicationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchApplication(accountName, applicationName, cancellationToken); + } + + /// + /// Gets a collection of BatchAccountCertificateResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. /// or is null. /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchAccountCertificateResources and their operations over a BatchAccountCertificateResource. + public static BatchAccountCertificateCollection GetBatchAccountCertificates(this ResourceGroupResource resourceGroupResource, string accountName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountCertificates(accountName); + } + + /// + /// Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName} + /// + /// + /// Operation Id + /// Certificate_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetBatchAccountAsync(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) + public static async Task> GetBatchAccountCertificateAsync(this ResourceGroupResource resourceGroupResource, string accountName, string certificateName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountCertificateAsync(accountName, certificateName, cancellationToken).ConfigureAwait(false); } /// - /// Gets information about the specified Batch account. + /// Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName} /// /// /// Operation Id - /// BatchAccount_Get + /// Certificate_Get /// /// /// Default Api Version @@ -276,25 +454,770 @@ public static async Task> GetBatchAccountAsync(th /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The name of the Batch account. + /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetBatchAccountCertificate(this ResourceGroupResource resourceGroupResource, string accountName, string certificateName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountCertificate(accountName, certificateName, cancellationToken); + } + + /// + /// Gets a collection of BatchPrivateLinkResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. /// or is null. /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchPrivateLinkResources and their operations over a BatchPrivateLinkResource. + public static BatchPrivateLinkResourceCollection GetBatchPrivateLinkResources(this ResourceGroupResource resourceGroupResource, string accountName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchPrivateLinkResources(accountName); + } + + /// + /// Gets information about the specified private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The private link resource name. This must be unique within the account. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetBatchPrivateLinkResourceAsync(this ResourceGroupResource resourceGroupResource, string accountName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchPrivateLinkResourceAsync(accountName, privateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The private link resource name. This must be unique within the account. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetBatchAccount(this ResourceGroupResource resourceGroupResource, string accountName, CancellationToken cancellationToken = default) + public static Response GetBatchPrivateLinkResource(this ResourceGroupResource resourceGroupResource, string accountName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchPrivateLinkResource(accountName, privateLinkResourceName, cancellationToken); + } + + /// + /// Gets a collection of BatchPrivateEndpointConnectionResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchPrivateEndpointConnectionResources and their operations over a BatchPrivateEndpointConnectionResource. + public static BatchPrivateEndpointConnectionCollection GetBatchPrivateEndpointConnections(this ResourceGroupResource resourceGroupResource, string accountName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchPrivateEndpointConnections(accountName); + } + + /// + /// Gets information about the specified private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The private endpoint connection name. This must be unique within the account. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetBatchPrivateEndpointConnectionAsync(this ResourceGroupResource resourceGroupResource, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchPrivateEndpointConnectionAsync(accountName, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The private endpoint connection name. This must be unique within the account. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetBatchPrivateEndpointConnection(this ResourceGroupResource resourceGroupResource, string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchPrivateEndpointConnection(accountName, privateEndpointConnectionName, cancellationToken); + } + + /// + /// Gets a collection of BatchAccountPoolResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchAccountPoolResources and their operations over a BatchAccountPoolResource. + public static BatchAccountPoolCollection GetBatchAccountPools(this ResourceGroupResource resourceGroupResource, string accountName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountPools(accountName); + } + + /// + /// Gets information about the specified pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName} + /// + /// + /// Operation Id + /// Pool_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The pool name. This must be unique within the account. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetBatchAccountPoolAsync(this ResourceGroupResource resourceGroupResource, string accountName, string poolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountPoolAsync(accountName, poolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName} + /// + /// + /// Operation Id + /// Pool_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The pool name. This must be unique within the account. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetBatchAccountPool(this ResourceGroupResource resourceGroupResource, string accountName, string poolName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountPool(accountName, poolName, cancellationToken); + } + + /// + /// Gets a collection of NetworkSecurityPerimeterConfigurationResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. + public static NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations(this ResourceGroupResource resourceGroupResource, string accountName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetNetworkSecurityPerimeterConfigurations(accountName); + } + + /// + /// Gets information about the specified NSP configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeter_GetConfiguration + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The name for Network Security Perimeter configuration. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetNetworkSecurityPerimeterConfigurationAsync(this ResourceGroupResource resourceGroupResource, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetNetworkSecurityPerimeterConfigurationAsync(accountName, networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified NSP configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeter_GetConfiguration + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Batch account. + /// The name for Network Security Perimeter configuration. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetNetworkSecurityPerimeterConfiguration(this ResourceGroupResource resourceGroupResource, string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetNetworkSecurityPerimeterConfiguration(accountName, networkSecurityPerimeterConfigurationName, cancellationToken); + } + + /// + /// Gets information about the Batch accounts associated with the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts + /// + /// + /// Operation Id + /// BatchAccount_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetBatchAccountsByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountsByResourceGroupAsync(cancellationToken); + } + + /// + /// Gets information about the Batch accounts associated with the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts + /// + /// + /// Operation Id + /// BatchAccount_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetBatchAccountsByResourceGroup(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccountsByResourceGroup(cancellationToken); + } + + /// + /// Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys + /// + /// + /// Operation Id + /// BatchAccount_SynchronizeAutoStorageKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + public static async Task SynchronizeAutoStorageKeysBatchAccountAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).SynchronizeAutoStorageKeysBatchAccountAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys + /// + /// + /// Operation Id + /// BatchAccount_SynchronizeAutoStorageKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + public static Response SynchronizeAutoStorageKeysBatchAccount(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).SynchronizeAutoStorageKeysBatchAccount(cancellationToken); + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys + /// + /// + /// Operation Id + /// BatchAccount_RegenerateKey + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The type of key to regenerate. + /// The cancellation token to use. + /// or is null. + public static async Task> RegenerateKeyBatchAccountAsync(this ResourceGroupResource resourceGroupResource, BatchAccountRegenerateKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).RegenerateKeyBatchAccountAsync(content, cancellationToken).ConfigureAwait(false); + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys + /// + /// + /// Operation Id + /// BatchAccount_RegenerateKey + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The type of key to regenerate. + /// The cancellation token to use. + /// or is null. + public static Response RegenerateKeyBatchAccount(this ResourceGroupResource resourceGroupResource, BatchAccountRegenerateKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).RegenerateKeyBatchAccount(content, cancellationToken); + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys + /// + /// + /// Operation Id + /// BatchAccount_GetKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + public static async Task> GetKeysBatchAccountAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableBatchResourceGroupResource(resourceGroupResource).GetKeysBatchAccountAsync(cancellationToken).ConfigureAwait(false); + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys + /// + /// + /// Operation Id + /// BatchAccount_GetKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + public static Response GetKeysBatchAccount(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetKeysBatchAccount(cancellationToken); + } + + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints + /// + /// + /// Operation Id + /// BatchAccount_ListOutboundNetworkDependenciesEndpoints + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetOutboundNetworkDependenciesEndpointsBatchAccountsAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetOutboundNetworkDependenciesEndpointsBatchAccountsAsync(cancellationToken); + } + + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints + /// + /// + /// Operation Id + /// BatchAccount_ListOutboundNetworkDependenciesEndpoints + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetOutboundNetworkDependenciesEndpointsBatchAccounts(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableBatchResourceGroupResource(resourceGroupResource).GetBatchAccount(accountName, cancellationToken); + return GetMockableBatchResourceGroupResource(resourceGroupResource).GetOutboundNetworkDependenciesEndpointsBatchAccounts(cancellationToken); } /// @@ -314,7 +1237,7 @@ public static Response GetBatchAccount(this ResourceGroupR /// /// /// Resource - /// + /// /// /// /// @@ -325,8 +1248,8 @@ public static Response GetBatchAccount(this ResourceGroupR /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetBatchAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetBatchAccountsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -350,7 +1273,7 @@ public static AsyncPageable GetBatchAccountsAsync(this Sub /// /// /// Resource - /// + /// /// /// /// @@ -361,8 +1284,8 @@ public static AsyncPageable GetBatchAccountsAsync(this Sub /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetBatchAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetBatchAccounts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchArmClient.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchArmClient.cs index 4a97c605a754..6392209bbdf4 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchArmClient.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchArmClient.cs @@ -34,18 +34,6 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual BatchAccountResource GetBatchAccountResource(ResourceIdentifier id) - { - BatchAccountResource.ValidateResourceId(id); - return new BatchAccountResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchResourceGroupResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchResourceGroupResource.cs index a57d945380f2..72b47276772e 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchResourceGroupResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchResourceGroupResource.cs @@ -8,13 +8,19 @@ using System; using System.Threading; using System.Threading.Tasks; +using Autorest.CSharp.Core; using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Batch.Models; namespace Azure.ResourceManager.Batch.Mocking { /// A class to add extension methods to ResourceGroupResource. public partial class MockableBatchResourceGroupResource : ArmResource { + private ClientDiagnostics _batchAccountDetectorBatchAccountClientDiagnostics; + private BatchAccountRestOperations _batchAccountDetectorBatchAccountRestClient; + /// Initializes a new instance of the class for mocking. protected MockableBatchResourceGroupResource() { @@ -27,29 +33,289 @@ internal MockableBatchResourceGroupResource(ArmClient client, ResourceIdentifier { } + private ClientDiagnostics BatchAccountDetectorBatchAccountClientDiagnostics => _batchAccountDetectorBatchAccountClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Batch", BatchAccountDetectorResource.ResourceType.Namespace, Diagnostics); + private BatchAccountRestOperations BatchAccountDetectorBatchAccountRestClient => _batchAccountDetectorBatchAccountRestClient ??= new BatchAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(BatchAccountDetectorResource.ResourceType)); + private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); return apiVersion; } - /// Gets a collection of BatchAccountResources in the ResourceGroupResource. - /// An object representing collection of BatchAccountResources and their operations over a BatchAccountResource. - public virtual BatchAccountCollection GetBatchAccounts() + /// Gets a collection of BatchAccountDetectorResources in the ResourceGroupResource. + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchAccountDetectorResources and their operations over a BatchAccountDetectorResource. + public virtual BatchAccountDetectorCollection GetBatchAccountDetectors(string accountName) + { + return new BatchAccountDetectorCollection(Client, Id, accountName); + } + + /// + /// Gets information about the given detector for a given Batch account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId} + /// + /// + /// Operation Id + /// BatchAccount_GetDetector + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The name of the detector. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBatchAccountDetectorAsync(string accountName, string detectorId, CancellationToken cancellationToken = default) + { + return await GetBatchAccountDetectors(accountName).GetAsync(detectorId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the given detector for a given Batch account. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/detectors/{detectorId} + /// + /// + /// Operation Id + /// BatchAccount_GetDetector + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The name of the detector. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBatchAccountDetector(string accountName, string detectorId, CancellationToken cancellationToken = default) + { + return GetBatchAccountDetectors(accountName).Get(detectorId, cancellationToken); + } + + /// Gets a collection of BatchApplicationResources in the ResourceGroupResource. + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchApplicationResources and their operations over a BatchApplicationResource. + public virtual BatchApplicationCollection GetBatchApplications(string accountName) + { + return new BatchApplicationCollection(Client, Id, accountName); + } + + /// + /// Gets information about the specified application. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName} + /// + /// + /// Operation Id + /// Application_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The name of the application. This must be unique within the account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBatchApplicationAsync(string accountName, string applicationName, CancellationToken cancellationToken = default) + { + return await GetBatchApplications(accountName).GetAsync(applicationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified application. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationName} + /// + /// + /// Operation Id + /// Application_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The name of the application. This must be unique within the account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBatchApplication(string accountName, string applicationName, CancellationToken cancellationToken = default) + { + return GetBatchApplications(accountName).Get(applicationName, cancellationToken); + } + + /// Gets a collection of BatchAccountCertificateResources in the ResourceGroupResource. + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchAccountCertificateResources and their operations over a BatchAccountCertificateResource. + public virtual BatchAccountCertificateCollection GetBatchAccountCertificates(string accountName) + { + return new BatchAccountCertificateCollection(Client, Id, accountName); + } + + /// + /// Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName} + /// + /// + /// Operation Id + /// Certificate_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBatchAccountCertificateAsync(string accountName, string certificateName, CancellationToken cancellationToken = default) + { + return await GetBatchAccountCertificates(accountName).GetAsync(certificateName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Warning: This operation is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/certificates/{certificateName} + /// + /// + /// Operation Id + /// Certificate_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBatchAccountCertificate(string accountName, string certificateName, CancellationToken cancellationToken = default) + { + return GetBatchAccountCertificates(accountName).Get(certificateName, cancellationToken); + } + + /// Gets a collection of BatchPrivateLinkResources in the ResourceGroupResource. + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchPrivateLinkResources and their operations over a BatchPrivateLinkResource. + public virtual BatchPrivateLinkResourceCollection GetBatchPrivateLinkResources(string accountName) + { + return new BatchPrivateLinkResourceCollection(Client, Id, accountName); + } + + /// + /// Gets information about the specified private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The private link resource name. This must be unique within the account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBatchPrivateLinkResourceAsync(string accountName, string privateLinkResourceName, CancellationToken cancellationToken = default) { - return GetCachedClient(client => new BatchAccountCollection(client, Id)); + return await GetBatchPrivateLinkResources(accountName).GetAsync(privateLinkResourceName, cancellationToken).ConfigureAwait(false); } /// - /// Gets information about the specified Batch account. + /// Gets information about the specified private link resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateLinkResources/{privateLinkResourceName} /// /// /// Operation Id - /// BatchAccount_Get + /// PrivateLinkResource_Get /// /// /// Default Api Version @@ -57,30 +323,73 @@ public virtual BatchAccountCollection GetBatchAccounts() /// /// /// Resource - /// + /// /// /// /// /// The name of the Batch account. + /// The private link resource name. This must be unique within the account. /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBatchPrivateLinkResource(string accountName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetBatchPrivateLinkResources(accountName).Get(privateLinkResourceName, cancellationToken); + } + + /// Gets a collection of BatchPrivateEndpointConnectionResources in the ResourceGroupResource. + /// The name of the Batch account. /// is null. /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchPrivateEndpointConnectionResources and their operations over a BatchPrivateEndpointConnectionResource. + public virtual BatchPrivateEndpointConnectionCollection GetBatchPrivateEndpointConnections(string accountName) + { + return new BatchPrivateEndpointConnectionCollection(Client, Id, accountName); + } + + /// + /// Gets information about the specified private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The private endpoint connection name. This must be unique within the account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetBatchAccountAsync(string accountName, CancellationToken cancellationToken = default) + public virtual async Task> GetBatchPrivateEndpointConnectionAsync(string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { - return await GetBatchAccounts().GetAsync(accountName, cancellationToken).ConfigureAwait(false); + return await GetBatchPrivateEndpointConnections(accountName).GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); } /// - /// Gets information about the specified Batch account. + /// Gets information about the specified private endpoint connection. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName} /// /// /// Operation Id - /// BatchAccount_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -88,18 +397,523 @@ public virtual async Task> GetBatchAccountAsync(s /// /// /// Resource - /// + /// /// /// /// /// The name of the Batch account. + /// The private endpoint connection name. This must be unique within the account. /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBatchPrivateEndpointConnection(string accountName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetBatchPrivateEndpointConnections(accountName).Get(privateEndpointConnectionName, cancellationToken); + } + + /// Gets a collection of BatchAccountPoolResources in the ResourceGroupResource. + /// The name of the Batch account. /// is null. /// is an empty string, and was expected to be non-empty. + /// An object representing collection of BatchAccountPoolResources and their operations over a BatchAccountPoolResource. + public virtual BatchAccountPoolCollection GetBatchAccountPools(string accountName) + { + return new BatchAccountPoolCollection(Client, Id, accountName); + } + + /// + /// Gets information about the specified pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName} + /// + /// + /// Operation Id + /// Pool_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The pool name. This must be unique within the account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetBatchAccount(string accountName, CancellationToken cancellationToken = default) + public virtual async Task> GetBatchAccountPoolAsync(string accountName, string poolName, CancellationToken cancellationToken = default) + { + return await GetBatchAccountPools(accountName).GetAsync(poolName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified pool. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/pools/{poolName} + /// + /// + /// Operation Id + /// Pool_Get + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The pool name. This must be unique within the account. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBatchAccountPool(string accountName, string poolName, CancellationToken cancellationToken = default) + { + return GetBatchAccountPools(accountName).Get(poolName, cancellationToken); + } + + /// Gets a collection of NetworkSecurityPerimeterConfigurationResources in the ResourceGroupResource. + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of NetworkSecurityPerimeterConfigurationResources and their operations over a NetworkSecurityPerimeterConfigurationResource. + public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurityPerimeterConfigurations(string accountName) + { + return new NetworkSecurityPerimeterConfigurationCollection(Client, Id, accountName); + } + + /// + /// Gets information about the specified NSP configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeter_GetConfiguration + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The name for Network Security Perimeter configuration. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNetworkSecurityPerimeterConfigurationAsync(string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + return await GetNetworkSecurityPerimeterConfigurations(accountName).GetAsync(networkSecurityPerimeterConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified NSP configuration. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName} + /// + /// + /// Operation Id + /// NetworkSecurityPerimeter_GetConfiguration + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Batch account. + /// The name for Network Security Perimeter configuration. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNetworkSecurityPerimeterConfiguration(string accountName, string networkSecurityPerimeterConfigurationName, CancellationToken cancellationToken = default) + { + return GetNetworkSecurityPerimeterConfigurations(accountName).Get(networkSecurityPerimeterConfigurationName, cancellationToken); + } + + /// + /// Gets information about the Batch accounts associated with the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts + /// + /// + /// Operation Id + /// BatchAccount_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetBatchAccountsByResourceGroupAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountDetectorBatchAccountRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountDetectorBatchAccountRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BatchAccount.DeserializeBatchAccount(e), BatchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "MockableBatchResourceGroupResource.GetBatchAccountsByResourceGroup", "value", "nextLink", cancellationToken); + } + + /// + /// Gets information about the Batch accounts associated with the specified resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts + /// + /// + /// Operation Id + /// BatchAccount_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetBatchAccountsByResourceGroup(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountDetectorBatchAccountRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountDetectorBatchAccountRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BatchAccount.DeserializeBatchAccount(e), BatchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "MockableBatchResourceGroupResource.GetBatchAccountsByResourceGroup", "value", "nextLink", cancellationToken); + } + + /// + /// Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys + /// + /// + /// Operation Id + /// BatchAccount_SynchronizeAutoStorageKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task SynchronizeAutoStorageKeysBatchAccountAsync(CancellationToken cancellationToken = default) + { + using var scope = BatchAccountDetectorBatchAccountClientDiagnostics.CreateScope("MockableBatchResourceGroupResource.SynchronizeAutoStorageKeysBatchAccount"); + scope.Start(); + try + { + var response = await BatchAccountDetectorBatchAccountRestClient.SynchronizeAutoStorageKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Synchronizes access keys for the auto-storage account configured for the specified Batch account, only if storage key authentication is being used. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys + /// + /// + /// Operation Id + /// BatchAccount_SynchronizeAutoStorageKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response SynchronizeAutoStorageKeysBatchAccount(CancellationToken cancellationToken = default) + { + using var scope = BatchAccountDetectorBatchAccountClientDiagnostics.CreateScope("MockableBatchResourceGroupResource.SynchronizeAutoStorageKeysBatchAccount"); + scope.Start(); + try + { + var response = BatchAccountDetectorBatchAccountRestClient.SynchronizeAutoStorageKeys(Id.SubscriptionId, Id.ResourceGroupName, _accountName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys + /// + /// + /// Operation Id + /// BatchAccount_RegenerateKey + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The type of key to regenerate. + /// The cancellation token to use. + /// is null. + public virtual async Task> RegenerateKeyBatchAccountAsync(BatchAccountRegenerateKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BatchAccountDetectorBatchAccountClientDiagnostics.CreateScope("MockableBatchResourceGroupResource.RegenerateKeyBatchAccount"); + scope.Start(); + try + { + var response = await BatchAccountDetectorBatchAccountRestClient.RegenerateKeyAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, regenerating the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys + /// + /// + /// Operation Id + /// BatchAccount_RegenerateKey + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The type of key to regenerate. + /// The cancellation token to use. + /// is null. + public virtual Response RegenerateKeyBatchAccount(BatchAccountRegenerateKeyContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = BatchAccountDetectorBatchAccountClientDiagnostics.CreateScope("MockableBatchResourceGroupResource.RegenerateKeyBatchAccount"); + scope.Start(); + try + { + var response = BatchAccountDetectorBatchAccountRestClient.RegenerateKey(Id.SubscriptionId, Id.ResourceGroupName, _accountName, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys + /// + /// + /// Operation Id + /// BatchAccount_GetKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetKeysBatchAccountAsync(CancellationToken cancellationToken = default) + { + using var scope = BatchAccountDetectorBatchAccountClientDiagnostics.CreateScope("MockableBatchResourceGroupResource.GetKeysBatchAccount"); + scope.Start(); + try + { + var response = await BatchAccountDetectorBatchAccountRestClient.GetKeysAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// This operation applies only to Batch accounts with allowedAuthenticationModes containing 'SharedKey'. If the Batch account doesn't contain 'SharedKey' in its allowedAuthenticationMode, clients cannot use shared keys to authenticate, and must use another allowedAuthenticationModes instead. In this case, getting the keys will fail. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys + /// + /// + /// Operation Id + /// BatchAccount_GetKeys + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetKeysBatchAccount(CancellationToken cancellationToken = default) + { + using var scope = BatchAccountDetectorBatchAccountClientDiagnostics.CreateScope("MockableBatchResourceGroupResource.GetKeysBatchAccount"); + scope.Start(); + try + { + var response = BatchAccountDetectorBatchAccountRestClient.GetKeys(Id.SubscriptionId, Id.ResourceGroupName, _accountName, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints + /// + /// + /// Operation Id + /// BatchAccount_ListOutboundNetworkDependenciesEndpoints + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOutboundNetworkDependenciesEndpointsBatchAccountsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountDetectorBatchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountDetectorBatchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BatchAccountOutboundEnvironmentEndpoint.DeserializeBatchAccountOutboundEnvironmentEndpoint(e), BatchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "MockableBatchResourceGroupResource.GetOutboundNetworkDependenciesEndpointsBatchAccounts", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/outboundNetworkDependenciesEndpoints + /// + /// + /// Operation Id + /// BatchAccount_ListOutboundNetworkDependenciesEndpoints + /// + /// + /// Default Api Version + /// 2024-07-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOutboundNetworkDependenciesEndpointsBatchAccounts(CancellationToken cancellationToken = default) { - return GetBatchAccounts().Get(accountName, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountDetectorBatchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountDetectorBatchAccountRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BatchAccountOutboundEnvironmentEndpoint.DeserializeBatchAccountOutboundEnvironmentEndpoint(e), BatchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "MockableBatchResourceGroupResource.GetOutboundNetworkDependenciesEndpointsBatchAccounts", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchSubscriptionResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchSubscriptionResource.cs index d991bd0083f9..62b62b587647 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchSubscriptionResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Extensions/MockableBatchSubscriptionResource.cs @@ -18,8 +18,8 @@ namespace Azure.ResourceManager.Batch.Mocking /// A class to add extension methods to SubscriptionResource. public partial class MockableBatchSubscriptionResource : ArmResource { - private ClientDiagnostics _batchAccountClientDiagnostics; - private BatchAccountRestOperations _batchAccountRestClient; + private ClientDiagnostics _batchAccountDetectorBatchAccountClientDiagnostics; + private BatchAccountRestOperations _batchAccountDetectorBatchAccountRestClient; private ClientDiagnostics _locationClientDiagnostics; private LocationRestOperations _locationRestClient; @@ -35,8 +35,8 @@ internal MockableBatchSubscriptionResource(ArmClient client, ResourceIdentifier { } - private ClientDiagnostics BatchAccountClientDiagnostics => _batchAccountClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Batch", BatchAccountResource.ResourceType.Namespace, Diagnostics); - private BatchAccountRestOperations BatchAccountRestClient => _batchAccountRestClient ??= new BatchAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(BatchAccountResource.ResourceType)); + private ClientDiagnostics BatchAccountDetectorBatchAccountClientDiagnostics => _batchAccountDetectorBatchAccountClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Batch", BatchAccountDetectorResource.ResourceType.Namespace, Diagnostics); + private BatchAccountRestOperations BatchAccountDetectorBatchAccountRestClient => _batchAccountDetectorBatchAccountRestClient ??= new BatchAccountRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(BatchAccountDetectorResource.ResourceType)); private ClientDiagnostics LocationClientDiagnostics => _locationClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Batch", ProviderConstants.DefaultProviderNamespace, Diagnostics); private LocationRestOperations LocationRestClient => _locationRestClient ??= new LocationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); @@ -63,17 +63,17 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetBatchAccountsAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetBatchAccountsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), BatchAccountClientDiagnostics, Pipeline, "MockableBatchSubscriptionResource.GetBatchAccounts", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountDetectorBatchAccountRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountDetectorBatchAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BatchAccount.DeserializeBatchAccount(e), BatchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "MockableBatchSubscriptionResource.GetBatchAccounts", "value", "nextLink", cancellationToken); } /// @@ -93,17 +93,17 @@ public virtual AsyncPageable GetBatchAccountsAsync(Cancell /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetBatchAccounts(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetBatchAccounts(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BatchAccountResource(Client, BatchAccountData.DeserializeBatchAccountData(e)), BatchAccountClientDiagnostics, Pipeline, "MockableBatchSubscriptionResource.GetBatchAccounts", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => BatchAccountDetectorBatchAccountRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => BatchAccountDetectorBatchAccountRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BatchAccount.DeserializeBatchAccount(e), BatchAccountDetectorBatchAccountClientDiagnostics, Pipeline, "MockableBatchSubscriptionResource.GetBatchAccounts", "value", "nextLink", cancellationToken); } /// diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/LongRunningOperation/BatchAccountOperationSource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/LongRunningOperation/BatchAccountOperationSource.cs deleted file mode 100644 index 1df824e3634c..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/LongRunningOperation/BatchAccountOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.Batch -{ - internal class BatchAccountOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal BatchAccountOperationSource(ArmClient client) - { - _client = client; - } - - BatchAccountResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = BatchAccountData.DeserializeBatchAccountData(document.RootElement); - return new BatchAccountResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = BatchAccountData.DeserializeBatchAccountData(document.RootElement); - return new BatchAccountResource(_client, data); - } - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs index 2a35975bc69c..c7eb18aff82f 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/AutomaticOSUpgradePolicy.cs @@ -52,7 +52,7 @@ public AutomaticOSUpgradePolicy() /// Initializes a new instance of . /// Whether OS image rollback feature should be disabled. - /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. + /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. /// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. /// Defer OS upgrades on the TVMs if they are running tasks. /// Keeps track of any properties unknown to the library. @@ -67,7 +67,7 @@ internal AutomaticOSUpgradePolicy(bool? disableAutomaticRollback, bool? enableAu /// Whether OS image rollback feature should be disabled. public bool? DisableAutomaticRollback { get; set; } - /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/en-us/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. + /// Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. <br /><br /> If this is set to true for Windows based pools, [WindowsConfiguration.enableAutomaticUpdates](https://learn.microsoft.com/rest/api/batchmanagement/pool/create?tabs=HTTP#windowsconfiguration) cannot be set to true. public bool? EnableAutomaticOSUpgrade { get; set; } /// Indicates whether rolling upgrade policy should be used during Auto OS Upgrade. Auto OS Upgrade will fallback to the default policy if no policy is defined on the VMSS. public bool? UseRollingUpgradePolicy { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountData.Serialization.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccount.Serialization.cs similarity index 93% rename from sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountData.Serialization.cs rename to sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccount.Serialization.cs index aea27d201e57..6ee734dfb6a3 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountData.Serialization.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccount.Serialization.cs @@ -10,16 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; -using Azure.ResourceManager.Batch.Models; using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.Batch +namespace Azure.ResourceManager.Batch.Models { - public partial class BatchAccountData : IUtf8JsonSerializable, IJsonModel + public partial class BatchAccount : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,10 +29,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BatchAccountData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(BatchAccount)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -212,19 +211,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - BatchAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + BatchAccount IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(BatchAccountData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(BatchAccount)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBatchAccountData(document.RootElement, options); + return DeserializeBatchAccount(document.RootElement, options); } - internal static BatchAccountData DeserializeBatchAccountData(JsonElement element, ModelReaderWriterOptions options = null) + internal static BatchAccount DeserializeBatchAccount(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -501,7 +500,7 @@ internal static BatchAccountData DeserializeBatchAccountData(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new BatchAccountData( + return new BatchAccount( id, name, type, @@ -529,35 +528,35 @@ internal static BatchAccountData DeserializeBatchAccountData(JsonElement element serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(BatchAccountData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(BatchAccount)} does not support writing '{options.Format}' format."); } } - BatchAccountData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + BatchAccount IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBatchAccountData(document.RootElement, options); + return DeserializeBatchAccount(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(BatchAccountData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(BatchAccount)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountData.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccount.cs similarity index 88% rename from sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountData.cs rename to sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccount.cs index 74f2a176d03e..b80fdee48b60 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/BatchAccountData.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccount.cs @@ -8,16 +8,12 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.Batch.Models; using Azure.ResourceManager.Models; -namespace Azure.ResourceManager.Batch +namespace Azure.ResourceManager.Batch.Models { - /// - /// A class representing the BatchAccount data model. - /// Contains information about an Azure Batch account. - /// - public partial class BatchAccountData : ResourceData + /// Contains information about an Azure Batch account. + public partial class BatchAccount : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,8 +47,8 @@ public partial class BatchAccountData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public BatchAccountData() + /// Initializes a new instance of . + public BatchAccount() { PrivateEndpointConnections = new ChangeTrackingList(); DedicatedCoreQuotaPerVmFamily = new ChangeTrackingList(); @@ -60,7 +56,7 @@ public BatchAccountData() Tags = new ChangeTrackingDictionary(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -86,7 +82,7 @@ public BatchAccountData() /// The location of the resource. /// The tags of the resource. /// Keeps track of any properties unknown to the library. - internal BatchAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ManagedServiceIdentity identity, string accountEndpoint, string nodeManagementEndpoint, BatchProvisioningState? provisioningState, BatchAccountPoolAllocationMode? poolAllocationMode, BatchKeyVaultReference keyVaultReference, BatchPublicNetworkAccess? publicNetworkAccess, BatchNetworkProfile networkProfile, IReadOnlyList privateEndpointConnections, BatchAccountAutoStorageConfiguration autoStorage, BatchAccountEncryptionConfiguration encryption, int? dedicatedCoreQuota, int? lowPriorityCoreQuota, IReadOnlyList dedicatedCoreQuotaPerVmFamily, bool? isDedicatedCoreQuotaPerVmFamilyEnforced, int? poolQuota, int? activeJobAndJobScheduleQuota, IReadOnlyList allowedAuthenticationModes, AzureLocation? location, IReadOnlyDictionary tags, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal BatchAccount(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ManagedServiceIdentity identity, string accountEndpoint, string nodeManagementEndpoint, BatchProvisioningState? provisioningState, BatchAccountPoolAllocationMode? poolAllocationMode, BatchKeyVaultReference keyVaultReference, BatchPublicNetworkAccess? publicNetworkAccess, BatchNetworkProfile networkProfile, IReadOnlyList privateEndpointConnections, BatchAccountAutoStorageConfiguration autoStorage, BatchAccountEncryptionConfiguration encryption, int? dedicatedCoreQuota, int? lowPriorityCoreQuota, IReadOnlyList dedicatedCoreQuotaPerVmFamily, bool? isDedicatedCoreQuotaPerVmFamilyEnforced, int? poolQuota, int? activeJobAndJobScheduleQuota, IReadOnlyList allowedAuthenticationModes, AzureLocation? location, IReadOnlyDictionary tags, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Identity = identity; AccountEndpoint = accountEndpoint; diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageBaseConfiguration.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageBaseConfiguration.cs index 340baee0375d..8f7fade1b63a 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageBaseConfiguration.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageBaseConfiguration.cs @@ -49,7 +49,7 @@ public partial class BatchAccountAutoStorageBaseConfiguration /// Initializes a new instance of . /// The resource ID of the storage account to be used for auto-storage account. /// is null. - public BatchAccountAutoStorageBaseConfiguration(ResourceIdentifier storageAccountId) + internal BatchAccountAutoStorageBaseConfiguration(ResourceIdentifier storageAccountId) { Argument.AssertNotNull(storageAccountId, nameof(storageAccountId)); @@ -75,21 +75,15 @@ internal BatchAccountAutoStorageBaseConfiguration() } /// The resource ID of the storage account to be used for auto-storage account. - public ResourceIdentifier StorageAccountId { get; set; } + public ResourceIdentifier StorageAccountId { get; } /// The authentication mode which the Batch service will use to manage the auto-storage account. - public BatchAutoStorageAuthenticationMode? AuthenticationMode { get; set; } + public BatchAutoStorageAuthenticationMode? AuthenticationMode { get; } /// The identity referenced here must be assigned to pools which have compute nodes that need access to auto-storage. - internal ComputeNodeIdentityReference NodeIdentity { get; set; } + internal ComputeNodeIdentityReference NodeIdentity { get; } /// The ARM resource id of the user assigned identity. public ResourceIdentifier NodeIdentityResourceId { - get => NodeIdentity is null ? default : NodeIdentity.ResourceId; - set - { - if (NodeIdentity is null) - NodeIdentity = new ComputeNodeIdentityReference(); - NodeIdentity.ResourceId = value; - } + get => NodeIdentity?.ResourceId; } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageConfiguration.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageConfiguration.cs index 876bae18d577..a3f1c5f3b927 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageConfiguration.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountAutoStorageConfiguration.cs @@ -18,7 +18,7 @@ public partial class BatchAccountAutoStorageConfiguration : BatchAccountAutoStor /// The resource ID of the storage account to be used for auto-storage account. /// The UTC time at which storage keys were last synchronized with the Batch account. /// is null. - public BatchAccountAutoStorageConfiguration(ResourceIdentifier storageAccountId, DateTimeOffset lastKeySyncedOn) : base(storageAccountId) + internal BatchAccountAutoStorageConfiguration(ResourceIdentifier storageAccountId, DateTimeOffset lastKeySyncedOn) : base(storageAccountId) { Argument.AssertNotNull(storageAccountId, nameof(storageAccountId)); @@ -42,6 +42,6 @@ internal BatchAccountAutoStorageConfiguration() } /// The UTC time at which storage keys were last synchronized with the Batch account. - public DateTimeOffset LastKeySyncedOn { get; set; } + public DateTimeOffset LastKeySyncedOn { get; } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.Serialization.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 5128bad6830b..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Batch.Models -{ - public partial class BatchAccountCreateOrUpdateContent : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BatchAccountCreateOrUpdateContent)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(AutoStorage)) - { - writer.WritePropertyName("autoStorage"u8); - writer.WriteObjectValue(AutoStorage, options); - } - if (Optional.IsDefined(PoolAllocationMode)) - { - writer.WritePropertyName("poolAllocationMode"u8); - writer.WriteStringValue(PoolAllocationMode.Value.ToSerialString()); - } - if (Optional.IsDefined(KeyVaultReference)) - { - writer.WritePropertyName("keyVaultReference"u8); - writer.WriteObjectValue(KeyVaultReference, options); - } - if (Optional.IsDefined(PublicNetworkAccess)) - { - writer.WritePropertyName("publicNetworkAccess"u8); - writer.WriteStringValue(PublicNetworkAccess.Value.ToSerialString()); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile, options); - } - if (Optional.IsDefined(Encryption)) - { - writer.WritePropertyName("encryption"u8); - writer.WriteObjectValue(Encryption, options); - } - if (Optional.IsCollectionDefined(AllowedAuthenticationModes)) - { - if (AllowedAuthenticationModes != null) - { - writer.WritePropertyName("allowedAuthenticationModes"u8); - writer.WriteStartArray(); - foreach (var item in AllowedAuthenticationModes) - { - writer.WriteStringValue(item.ToSerialString()); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("allowedAuthenticationModes"); - } - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - BatchAccountCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BatchAccountCreateOrUpdateContent)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBatchAccountCreateOrUpdateContent(document.RootElement, options); - } - - internal static BatchAccountCreateOrUpdateContent DeserializeBatchAccountCreateOrUpdateContent(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - AzureLocation location = default; - IDictionary tags = default; - ManagedServiceIdentity identity = default; - BatchAccountAutoStorageBaseConfiguration autoStorage = default; - BatchAccountPoolAllocationMode? poolAllocationMode = default; - BatchKeyVaultReference keyVaultReference = default; - BatchPublicNetworkAccess? publicNetworkAccess = default; - BatchNetworkProfile networkProfile = default; - BatchAccountEncryptionConfiguration encryption = default; - IList allowedAuthenticationModes = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("autoStorage"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoStorage = BatchAccountAutoStorageBaseConfiguration.DeserializeBatchAccountAutoStorageBaseConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("poolAllocationMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - poolAllocationMode = property0.Value.GetString().ToBatchAccountPoolAllocationMode(); - continue; - } - if (property0.NameEquals("keyVaultReference"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - keyVaultReference = BatchKeyVaultReference.DeserializeBatchKeyVaultReference(property0.Value, options); - continue; - } - if (property0.NameEquals("publicNetworkAccess"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - publicNetworkAccess = property0.Value.GetString().ToBatchPublicNetworkAccess(); - continue; - } - if (property0.NameEquals("networkProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = BatchNetworkProfile.DeserializeBatchNetworkProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("encryption"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - encryption = BatchAccountEncryptionConfiguration.DeserializeBatchAccountEncryptionConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("allowedAuthenticationModes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - allowedAuthenticationModes = null; - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString().ToBatchAuthenticationMode()); - } - allowedAuthenticationModes = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BatchAccountCreateOrUpdateContent( - location, - tags ?? new ChangeTrackingDictionary(), - identity, - autoStorage, - poolAllocationMode, - keyVaultReference, - publicNetworkAccess, - networkProfile, - encryption, - allowedAuthenticationModes ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(BatchAccountCreateOrUpdateContent)} does not support writing '{options.Format}' format."); - } - } - - BatchAccountCreateOrUpdateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBatchAccountCreateOrUpdateContent(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BatchAccountCreateOrUpdateContent)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.cs deleted file mode 100644 index 70b121dc09d6..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountCreateOrUpdateContent.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Batch.Models -{ - /// Parameters supplied to the Create operation. - public partial class BatchAccountCreateOrUpdateContent - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The region in which to create the account. - public BatchAccountCreateOrUpdateContent(AzureLocation location) - { - Location = location; - Tags = new ChangeTrackingDictionary(); - AllowedAuthenticationModes = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The region in which to create the account. - /// The user-specified tags associated with the account. - /// The identity of the Batch account. Current supported identity types: None, SystemAssigned, UserAssigned. - /// The properties related to the auto-storage account. - /// The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Microsoft Entra ID. If the mode is UserSubscription, clients must use Microsoft Entra ID. The default is BatchService. - /// A reference to the Azure key vault associated with the Batch account. - /// If not specified, the default value is 'enabled'. - /// The network profile only takes effect when publicNetworkAccess is enabled. - /// Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. - /// List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. - /// Keeps track of any properties unknown to the library. - internal BatchAccountCreateOrUpdateContent(AzureLocation location, IDictionary tags, ManagedServiceIdentity identity, BatchAccountAutoStorageBaseConfiguration autoStorage, BatchAccountPoolAllocationMode? poolAllocationMode, BatchKeyVaultReference keyVaultReference, BatchPublicNetworkAccess? publicNetworkAccess, BatchNetworkProfile networkProfile, BatchAccountEncryptionConfiguration encryption, IList allowedAuthenticationModes, IDictionary serializedAdditionalRawData) - { - Location = location; - Tags = tags; - Identity = identity; - AutoStorage = autoStorage; - PoolAllocationMode = poolAllocationMode; - KeyVaultReference = keyVaultReference; - PublicNetworkAccess = publicNetworkAccess; - NetworkProfile = networkProfile; - Encryption = encryption; - AllowedAuthenticationModes = allowedAuthenticationModes; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal BatchAccountCreateOrUpdateContent() - { - } - - /// The region in which to create the account. - public AzureLocation Location { get; } - /// The user-specified tags associated with the account. - public IDictionary Tags { get; } - /// The identity of the Batch account. Current supported identity types: None, SystemAssigned, UserAssigned. - public ManagedServiceIdentity Identity { get; set; } - /// The properties related to the auto-storage account. - public BatchAccountAutoStorageBaseConfiguration AutoStorage { get; set; } - /// The pool allocation mode also affects how clients may authenticate to the Batch Service API. If the mode is BatchService, clients may authenticate using access keys or Microsoft Entra ID. If the mode is UserSubscription, clients must use Microsoft Entra ID. The default is BatchService. - public BatchAccountPoolAllocationMode? PoolAllocationMode { get; set; } - /// A reference to the Azure key vault associated with the Batch account. - public BatchKeyVaultReference KeyVaultReference { get; set; } - /// If not specified, the default value is 'enabled'. - public BatchPublicNetworkAccess? PublicNetworkAccess { get; set; } - /// The network profile only takes effect when publicNetworkAccess is enabled. - public BatchNetworkProfile NetworkProfile { get; set; } - /// Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. - public BatchAccountEncryptionConfiguration Encryption { get; set; } - /// List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. - public IList AllowedAuthenticationModes { get; set; } - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountEncryptionConfiguration.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountEncryptionConfiguration.cs index 25d249b458cb..b32e9cac41a5 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountEncryptionConfiguration.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountEncryptionConfiguration.cs @@ -46,7 +46,7 @@ public partial class BatchAccountEncryptionConfiguration private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public BatchAccountEncryptionConfiguration() + internal BatchAccountEncryptionConfiguration() { } @@ -62,9 +62,9 @@ internal BatchAccountEncryptionConfiguration(BatchAccountKeySource? keySource, K } /// Type of the key source. - public BatchAccountKeySource? KeySource { get; set; } + public BatchAccountKeySource? KeySource { get; } /// Additional details when using Microsoft.KeyVault. - internal KeyVaultProperties KeyVaultProperties { get; set; } + internal KeyVaultProperties KeyVaultProperties { get; } /// /// Full path to the secret with or without version. Example https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053. or https://mykeyvault.vault.azure.net/keys/testkey. To be usable the following prerequisites must be met: /// @@ -74,13 +74,7 @@ internal BatchAccountEncryptionConfiguration(BatchAccountKeySource? keySource, K /// public Uri KeyIdentifier { - get => KeyVaultProperties is null ? default : KeyVaultProperties.KeyIdentifier; - set - { - if (KeyVaultProperties is null) - KeyVaultProperties = new KeyVaultProperties(); - KeyVaultProperties.KeyIdentifier = value; - } + get => KeyVaultProperties?.KeyIdentifier; } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.Serialization.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.Serialization.cs index 4b7e9e7b4615..4e4e45ebed1a 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.Serialization.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.Serialization.cs @@ -86,7 +86,7 @@ internal static BatchAccountListResult DeserializeBatchAccountListResult(JsonEle { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -98,10 +98,10 @@ internal static BatchAccountListResult DeserializeBatchAccountListResult(JsonEle { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(BatchAccountData.DeserializeBatchAccountData(item, options)); + array.Add(BatchAccount.DeserializeBatchAccount(item, options)); } value = array; continue; @@ -117,7 +117,7 @@ internal static BatchAccountListResult DeserializeBatchAccountListResult(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new BatchAccountListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new BatchAccountListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.cs index fce7cbcf1b7a..e8d04c815fb5 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountListResult.cs @@ -48,14 +48,14 @@ internal partial class BatchAccountListResult /// Initializes a new instance of . internal BatchAccountListResult() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of . /// The collection of Batch accounts returned by the listing operation. /// The continuation token. /// Keeps track of any properties unknown to the library. - internal BatchAccountListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal BatchAccountListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -63,7 +63,7 @@ internal BatchAccountListResult(IReadOnlyList value, string ne } /// The collection of Batch accounts returned by the listing operation. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The continuation token. public string NextLink { get; } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.Serialization.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.Serialization.cs deleted file mode 100644 index a98cc6fb6f9a..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.Serialization.cs +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Batch.Models -{ - public partial class BatchAccountPatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BatchAccountPatch)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(AutoStorage)) - { - writer.WritePropertyName("autoStorage"u8); - writer.WriteObjectValue(AutoStorage, options); - } - if (Optional.IsDefined(Encryption)) - { - writer.WritePropertyName("encryption"u8); - writer.WriteObjectValue(Encryption, options); - } - if (Optional.IsCollectionDefined(AllowedAuthenticationModes)) - { - if (AllowedAuthenticationModes != null) - { - writer.WritePropertyName("allowedAuthenticationModes"u8); - writer.WriteStartArray(); - foreach (var item in AllowedAuthenticationModes) - { - writer.WriteStringValue(item.ToSerialString()); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("allowedAuthenticationModes"); - } - } - if (Optional.IsDefined(PublicNetworkAccess)) - { - writer.WritePropertyName("publicNetworkAccess"u8); - writer.WriteStringValue(PublicNetworkAccess.Value.ToSerialString()); - } - if (Optional.IsDefined(NetworkProfile)) - { - writer.WritePropertyName("networkProfile"u8); - writer.WriteObjectValue(NetworkProfile, options); - } - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - BatchAccountPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(BatchAccountPatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeBatchAccountPatch(document.RootElement, options); - } - - internal static BatchAccountPatch DeserializeBatchAccountPatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - ManagedServiceIdentity identity = default; - BatchAccountAutoStorageBaseConfiguration autoStorage = default; - BatchAccountEncryptionConfiguration encryption = default; - IList allowedAuthenticationModes = default; - BatchPublicNetworkAccess? publicNetworkAccess = default; - BatchNetworkProfile networkProfile = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("autoStorage"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoStorage = BatchAccountAutoStorageBaseConfiguration.DeserializeBatchAccountAutoStorageBaseConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("encryption"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - encryption = BatchAccountEncryptionConfiguration.DeserializeBatchAccountEncryptionConfiguration(property0.Value, options); - continue; - } - if (property0.NameEquals("allowedAuthenticationModes"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - allowedAuthenticationModes = null; - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString().ToBatchAuthenticationMode()); - } - allowedAuthenticationModes = array; - continue; - } - if (property0.NameEquals("publicNetworkAccess"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - publicNetworkAccess = property0.Value.GetString().ToBatchPublicNetworkAccess(); - continue; - } - if (property0.NameEquals("networkProfile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkProfile = BatchNetworkProfile.DeserializeBatchNetworkProfile(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new BatchAccountPatch( - tags ?? new ChangeTrackingDictionary(), - identity, - autoStorage, - encryption, - allowedAuthenticationModes ?? new ChangeTrackingList(), - publicNetworkAccess, - networkProfile, - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(BatchAccountPatch)} does not support writing '{options.Format}' format."); - } - } - - BatchAccountPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data); - return DeserializeBatchAccountPatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(BatchAccountPatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.cs deleted file mode 100644 index dec2471231d3..000000000000 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchAccountPatch.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.Batch.Models -{ - /// Parameters for updating an Azure Batch account. - public partial class BatchAccountPatch - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public BatchAccountPatch() - { - Tags = new ChangeTrackingDictionary(); - AllowedAuthenticationModes = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The user-specified tags associated with the account. - /// The identity of the Batch account. Current supported identity types: None, SystemAssigned, UserAssigned. - /// The properties related to the auto-storage account. - /// Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. - /// List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. - /// If not specified, the default value is 'enabled'. - /// The network profile only takes effect when publicNetworkAccess is enabled. - /// Keeps track of any properties unknown to the library. - internal BatchAccountPatch(IDictionary tags, ManagedServiceIdentity identity, BatchAccountAutoStorageBaseConfiguration autoStorage, BatchAccountEncryptionConfiguration encryption, IList allowedAuthenticationModes, BatchPublicNetworkAccess? publicNetworkAccess, BatchNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) - { - Tags = tags; - Identity = identity; - AutoStorage = autoStorage; - Encryption = encryption; - AllowedAuthenticationModes = allowedAuthenticationModes; - PublicNetworkAccess = publicNetworkAccess; - NetworkProfile = networkProfile; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The user-specified tags associated with the account. - public IDictionary Tags { get; } - /// The identity of the Batch account. Current supported identity types: None, SystemAssigned, UserAssigned. - public ManagedServiceIdentity Identity { get; set; } - /// The properties related to the auto-storage account. - public BatchAccountAutoStorageBaseConfiguration AutoStorage { get; set; } - /// Configures how customer data is encrypted inside the Batch account. By default, accounts are encrypted using a Microsoft managed key. For additional control, a customer-managed key can be used instead. - public BatchAccountEncryptionConfiguration Encryption { get; set; } - /// List of allowed authentication modes for the Batch account that can be used to authenticate with the data plane. This does not affect authentication with the control plane. - public IList AllowedAuthenticationModes { get; set; } - /// If not specified, the default value is 'enabled'. - public BatchPublicNetworkAccess? PublicNetworkAccess { get; set; } - /// The network profile only takes effect when publicNetworkAccess is enabled. - public BatchNetworkProfile NetworkProfile { get; set; } - } -} diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs index 326191d9b4af..2e50c6f8f081 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchDiffDiskPlacement.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Batch.Models { - /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public readonly partial struct BatchDiffDiskPlacement : IEquatable { private readonly string _value; diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs index d4284074a1ed..8b4938d41bd0 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchImageReference.cs @@ -56,7 +56,7 @@ public BatchImageReference() /// For example, UbuntuServer or WindowsServer. /// For example, 18.04-LTS or 2022-datacenter. /// A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. /// This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. /// This property is mutually exclusive with other properties and can be fetched from community gallery image GET call. /// Keeps track of any properties unknown to the library. @@ -80,7 +80,7 @@ internal BatchImageReference(string publisher, string offer, string sku, string public string Sku { get; set; } /// A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. public string Version { get; set; } - /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// This property is mutually exclusive with other properties. The Azure Compute Gallery Image must have replicas in the same region as the Azure Batch account. For information about the firewall settings for the Batch node agent to communicate with the Batch service see https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. public ResourceIdentifier Id { get; set; } /// This property is mutually exclusive with other properties and can be fetched from shared gallery image GET call. public string SharedGalleryImageId { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs index 19462ffa53ab..95bc37265923 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchInboundNatPool.cs @@ -48,7 +48,7 @@ public partial class BatchInboundNatPool /// Initializes a new instance of . /// The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. /// The protocol of the endpoint. - /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// is null. @@ -67,7 +67,7 @@ public BatchInboundNatPool(string name, BatchInboundEndpointProtocol protocol, i /// Initializes a new instance of . /// The name must be unique within a Batch pool, can contain letters, numbers, underscores, periods, and hyphens. Names must start with a letter or number, must end with a letter, number, or underscore, and cannot exceed 77 characters. If any invalid values are provided the request fails with HTTP status code 400. /// The protocol of the endpoint. - /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved by the Batch service. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. /// The maximum number of rules that can be specified across all the endpoints on a Batch pool is 25. If no network security group rules are specified, a default rule will be created to allow inbound access to the specified backendPort. If the maximum number of network security group rules is exceeded the request fails with HTTP status code 400. @@ -92,7 +92,7 @@ internal BatchInboundNatPool() public string Name { get; set; } /// The protocol of the endpoint. public BatchInboundEndpointProtocol Protocol { get; set; } - /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 22, 3389, 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. + /// This must be unique within a Batch pool. Acceptable values are between 1 and 65535 except for 29876 and 29877 as these are reserved. If any reserved values are provided the request fails with HTTP status code 400. public int BackendPort { get; set; } /// Acceptable values range between 1 and 65534 except ports from 50000 to 55000 which are reserved. All ranges within a pool must be distinct and cannot overlap. If any reserved or overlapping values are provided the request fails with HTTP status code 400. public int FrontendPortRangeStart { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchKeyVaultReference.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchKeyVaultReference.cs index 559ca699f5a8..f3260d1d3e18 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchKeyVaultReference.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchKeyVaultReference.cs @@ -50,7 +50,7 @@ public partial class BatchKeyVaultReference /// The resource ID of the Azure key vault associated with the Batch account. /// The URL of the Azure key vault associated with the Batch account. /// or is null. - public BatchKeyVaultReference(ResourceIdentifier id, Uri uri) + internal BatchKeyVaultReference(ResourceIdentifier id, Uri uri) { Argument.AssertNotNull(id, nameof(id)); Argument.AssertNotNull(uri, nameof(uri)); @@ -76,8 +76,8 @@ internal BatchKeyVaultReference() } /// The resource ID of the Azure key vault associated with the Batch account. - public ResourceIdentifier Id { get; set; } + public ResourceIdentifier Id { get; } /// The URL of the Azure key vault associated with the Batch account. - public Uri Uri { get; set; } + public Uri Uri { get; } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs index 9dbdff49437c..b08aebe2347f 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchNetworkConfiguration.cs @@ -52,7 +52,7 @@ public BatchNetworkConfiguration() } /// Initializes a new instance of . - /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication,including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. /// The scope of dynamic vnet assignment. /// The endpoint configuration for a pool. /// The public IP Address configuration of the networking configuration of a Pool. @@ -68,7 +68,7 @@ internal BatchNetworkConfiguration(ResourceIdentifier subnetId, DynamicVNetAssig _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication. Enable ports 29876 and 29877, as well as port 22 for Linux and port 3389 for Windows. Also enable outbound connections to Azure Storage on port 443. For more details see: https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. + /// The virtual network must be in the same region and subscription as the Azure Batch account. The specified subnet should have enough free IP addresses to accommodate the number of nodes in the pool. If the subnet doesn't have enough free IP addresses, the pool will partially allocate compute nodes and a resize error will occur. The 'MicrosoftAzureBatch' service principal must have the 'Classic Virtual Machine Contributor' Role-Based Access Control (RBAC) role for the specified VNet. The specified subnet must allow communication from the Azure Batch service to be able to schedule tasks on the compute nodes. This can be verified by checking if the specified VNet has any associated Network Security Groups (NSG). If communication to the compute nodes in the specified subnet is denied by an NSG, then the Batch service will set the state of the compute nodes to unusable. If the specified VNet has any associated Network Security Groups (NSG), then a few reserved system ports must be enabled for inbound communication,including ports 29876 and 29877. Also enable outbound connections to Azure Storage on port 443. For more details see: https://learn.microsoft.com/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration. public ResourceIdentifier SubnetId { get; set; } /// The scope of dynamic vnet assignment. public DynamicVNetAssignmentScope? DynamicVNetAssignmentScope { get; set; } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs index 69c86e39dbb4..225d214b07b8 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/BatchOSDisk.cs @@ -69,7 +69,7 @@ internal BatchOSDisk(DiffDiskSettings ephemeralOSDiskSettings, BatchDiskCachingT /// Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. internal DiffDiskSettings EphemeralOSDiskSettings { get; set; } - /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public BatchDiffDiskPlacement? EphemeralOSDiskPlacement { get => EphemeralOSDiskSettings is null ? default : EphemeralOSDiskSettings.Placement; diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs index f03202a6036f..f749e9c67a65 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/DiffDiskSettings.cs @@ -51,7 +51,7 @@ public DiffDiskSettings() } /// Initializes a new instance of . - /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. /// Keeps track of any properties unknown to the library. internal DiffDiskSettings(BatchDiffDiskPlacement? placement, IDictionary serializedAdditionalRawData) { @@ -59,7 +59,7 @@ internal DiffDiskSettings(BatchDiffDiskPlacement? placement, IDictionary This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. + /// This property can be used by user in the request to choose which location the operating system should be in. e.g., cache disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer to Ephemeral OS disk size requirements for Windows VMs at https://learn.microsoft.com/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VMs at https://learn.microsoft.com/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements. public BatchDiffDiskPlacement? Placement { get; set; } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/KeyVaultProperties.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/KeyVaultProperties.cs index 21ab8464e8b6..c45e0a6a51ce 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/KeyVaultProperties.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/Models/KeyVaultProperties.cs @@ -46,7 +46,7 @@ internal partial class KeyVaultProperties private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public KeyVaultProperties() + internal KeyVaultProperties() { } @@ -72,6 +72,6 @@ internal KeyVaultProperties(Uri keyIdentifier, IDictionary s /// The account identity has been granted Key/Get, Key/Unwrap and Key/Wrap permissions /// The KeyVault has soft-delete and purge protection enabled /// - public Uri KeyIdentifier { get; set; } + public Uri KeyIdentifier { get; } } } diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs index fba3c8f7b66e..3b35b8bfbaa1 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs @@ -14,18 +14,20 @@ using Autorest.CSharp.Core; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { /// /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetNetworkSecurityPerimeterConfigurations method from an instance of . + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetNetworkSecurityPerimeterConfigurations method from an instance of . /// public partial class NetworkSecurityPerimeterConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable { private readonly ClientDiagnostics _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterClientDiagnostics; private readonly NetworkSecurityPerimeterRestOperations _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient; + private readonly string _accountName; /// Initializes a new instance of the class for mocking. protected NetworkSecurityPerimeterConfigurationCollection() @@ -35,8 +37,12 @@ protected NetworkSecurityPerimeterConfigurationCollection() /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the parent resource that is the target of operations. - internal NetworkSecurityPerimeterConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + /// The name of the Batch account. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal NetworkSecurityPerimeterConfigurationCollection(ArmClient client, ResourceIdentifier id, string accountName) : base(client, id) { + _accountName = accountName; _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Batch", NetworkSecurityPerimeterConfigurationResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(NetworkSecurityPerimeterConfigurationResource.ResourceType, out string networkSecurityPerimeterConfigurationNetworkSecurityPerimeterApiVersion); _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient = new NetworkSecurityPerimeterRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, networkSecurityPerimeterConfigurationNetworkSecurityPerimeterApiVersion); @@ -47,8 +53,8 @@ internal NetworkSecurityPerimeterConfigurationCollection(ArmClient client, Resou internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != BatchAccountResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BatchAccountResource.ResourceType), nameof(id)); + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } /// @@ -84,7 +90,7 @@ public virtual async Task Get(strin scope.Start(); try { - var response = _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken); + var response = _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfiguration(Id.SubscriptionId, Id.ResourceGroupName, _accountName, networkSecurityPerimeterConfigurationName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); @@ -166,8 +172,8 @@ public virtual Response Get(strin /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -196,8 +202,8 @@ public virtual AsyncPageable GetA /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, Id.ResourceGroupName, _accountName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _accountName); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NetworkSecurityPerimeterConfigurationResource(Client, NetworkSecurityPerimeterConfigurationData.DeserializeNetworkSecurityPerimeterConfigurationData(e)), _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterClientDiagnostics, Pipeline, "NetworkSecurityPerimeterConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); } @@ -234,7 +240,7 @@ public virtual async Task> ExistsAsync(string networkSecurityPeri scope.Start(); try { - var response = await _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, _accountName, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -277,7 +283,7 @@ public virtual Response Exists(string networkSecurityPerimeterConfiguratio scope.Start(); try { - var response = _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); + var response = _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfiguration(Id.SubscriptionId, Id.ResourceGroupName, _accountName, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -320,7 +326,7 @@ public virtual async Task(response.GetRawResponse()); return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); @@ -365,7 +371,7 @@ public virtual NullableResponse G scope.Start(); try { - var response = _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); + var response = _networkSecurityPerimeterConfigurationNetworkSecurityPerimeterRestClient.GetConfiguration(Id.SubscriptionId, Id.ResourceGroupName, _accountName, networkSecurityPerimeterConfigurationName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new NetworkSecurityPerimeterConfigurationResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs index 78a7d350ed56..efbfd9491318 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.Batch { @@ -18,7 +19,7 @@ namespace Azure.ResourceManager.Batch /// A Class representing a NetworkSecurityPerimeterConfiguration along with the instance operations that can be performed on it. /// If you have a you can construct a /// from an instance of using the GetNetworkSecurityPerimeterConfigurationResource method. - /// Otherwise you can get one from its parent resource using the GetNetworkSecurityPerimeterConfiguration method. + /// Otherwise you can get one from its parent resource using the GetNetworkSecurityPerimeterConfiguration method. /// public partial class NetworkSecurityPerimeterConfigurationResource : ArmResource { diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs index 725fec7b026a..9debfdd9c31d 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs +++ b/sdk/batch/Azure.ResourceManager.Batch/src/Generated/RestOperations/BatchAccountRestOperations.cs @@ -36,380 +36,6 @@ public BatchAccountRestOperations(HttpPipeline pipeline, string applicationId, U _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string accountName, BatchAccountCreateOrUpdateContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string accountName, BatchAccountCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. - /// Additional parameters for account creation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAsync(string subscriptionId, string resourceGroupName, string accountName, BatchAccountCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. - /// Additional parameters for account creation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string accountName, BatchAccountCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, accountName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string accountName, BatchAccountPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string accountName, BatchAccountPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the properties of an existing Batch account. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// The name of the Batch account. - /// Additional parameters for account update. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string accountName, BatchAccountPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BatchAccountData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BatchAccountData.DeserializeBatchAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the properties of an existing Batch account. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// The name of the Batch account. - /// Additional parameters for account update. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string accountName, BatchAccountPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, accountName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BatchAccountData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BatchAccountData.DeserializeBatchAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes the specified Batch account. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// The name of the Batch account. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes the specified Batch account. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// The name of the Batch account. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string accountName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string accountName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Batch/batchAccounts/", false); - uri.AppendPath(accountName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets information about the specified Batch account. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// The name of the Batch account. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - BatchAccountData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BatchAccountData.DeserializeBatchAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((BatchAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets information about the specified Batch account. - /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// The name of the resource group that contains the Batch account. - /// The name of the Batch account. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string accountName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, accountName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - BatchAccountData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BatchAccountData.DeserializeBatchAccountData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((BatchAccountData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId) { var uri = new RawRequestUriBuilder(); @@ -1088,7 +714,7 @@ internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(strin return message; } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. /// The name of the Batch account. @@ -1117,7 +743,7 @@ public async Task> ListOutboundN } } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. /// The name of the Batch account. @@ -1408,7 +1034,7 @@ internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsNextPageReque return message; } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The URL to the next page of results. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. @@ -1439,7 +1065,7 @@ public async Task> ListOutboundN } } - /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://docs.microsoft.com/en-us/azure/batch/batch-virtual-network. + /// Lists the endpoints that a Batch Compute Node under this Batch Account may call as part of Batch service administration. If you are deploying a Pool inside of a virtual network that you specify, you must make sure your network allows outbound access to these endpoints. Failure to allow access to these endpoints may cause Batch to mark the affected nodes as unusable. For more information about creating a pool inside of a virtual network, see https://learn.microsoft.com/azure/batch/batch-virtual-network. /// The URL to the next page of results. /// The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). /// The name of the resource group that contains the Batch account. diff --git a/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md b/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md index d4eb24a31dc2..4a277015bde7 100644 --- a/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md +++ b/sdk/batch/Azure.ResourceManager.Batch/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Batch namespace: Azure.ResourceManager.Batch -require: https://github.com/Azure/azure-rest-api-specs/blob/d85634405ec3b905f1b0bfc350e47cb704aedb61/specification/batch/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/batch/resource-manager/readme.md #tag: package-2024-07 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index d8bf790b5988..f28c28a5d39c 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -79,7 +79,6 @@ trigger: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan @@ -108,6 +107,7 @@ trigger: - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto @@ -285,7 +285,6 @@ pr: - sdk/dnsresolver/Azure.ResourceManager.DnsResolver - sdk/dynatrace/Azure.ResourceManager.Dynatrace - sdk/edgeorder/Azure.ResourceManager.EdgeOrder - - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/edgezones/Azure.ResourceManager.EdgeZones - sdk/elastic/Azure.ResourceManager.Elastic - sdk/elasticsan/Azure.ResourceManager.ElasticSan @@ -314,6 +313,7 @@ pr: - sdk/iot/Azure.ResourceManager.IotFirmwareDefense - sdk/iotcentral/Azure.ResourceManager.IotCentral - sdk/iothub/Azure.ResourceManager.IotHub + - sdk/iotoperations/Azure.ResourceManager.IotOperations - sdk/keyvault/Azure.ResourceManager.KeyVault - sdk/kubernetesconfiguration/Azure.ResourceManager.KubernetesConfiguration - sdk/kusto/Azure.ResourceManager.Kusto