diff --git a/samples/Azure.Management.Storage/Azure.Management.Storage.csproj b/samples/Azure.Management.Storage/Azure.Management.Storage.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/samples/Azure.Management.Storage/Azure.Management.Storage.csproj +++ b/samples/Azure.Management.Storage/Azure.Management.Storage.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs b/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs index 685b67e4f3b..c54a0172b1c 100644 --- a/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs +++ b/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs @@ -14,7 +14,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -161,10 +160,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string containerName, CancellationToken cancellationToken = default) + public Response Get(string containerName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.Get"); scope.Start(); @@ -185,10 +184,10 @@ public override Response Get(string containerName, CancellationTo } } - /// + /// Gets details for this resource from the service. /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string containerName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string containerName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.Get"); scope.Start(); diff --git a/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs b/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs index a7ecb5c5784..1e3de8e3caf 100644 --- a/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs +++ b/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs @@ -14,7 +14,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -161,10 +160,10 @@ public async Task StartCreateOrUpdate } } - /// + /// Gets details for this resource from the service. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string accountName, CancellationToken cancellationToken = default) + public Response Get(string accountName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.Get"); scope.Start(); @@ -185,10 +184,10 @@ public override Response Get(string accountName, CancellationToken } } - /// + /// Gets details for this resource from the service. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string accountName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string accountName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.Get"); scope.Start(); diff --git a/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs b/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs index 21f1f52bf9e..75f41c089e9 100644 --- a/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs +++ b/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs @@ -14,7 +14,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -161,10 +160,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string encryptionScopeName, CancellationToken cancellationToken = default) + public Response Get(string encryptionScopeName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.Get"); scope.Start(); @@ -185,10 +184,10 @@ public override Response Get(string encryptionScopeName, Cancel } } - /// + /// Gets details for this resource from the service. /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string encryptionScopeName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string encryptionScopeName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.Get"); scope.Start(); diff --git a/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs b/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs index 7b5b42feee3..1c456cb1b75 100644 --- a/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs +++ b/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs @@ -14,7 +14,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -161,10 +160,10 @@ public async Task StartCreateOrUpdate } } - /// + /// Gets details for this resource from the service. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string accountName, CancellationToken cancellationToken = default) + public Response Get(string accountName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.Get"); scope.Start(); @@ -185,10 +184,10 @@ public override Response Get(string accountName, CancellationToken } } - /// + /// Gets details for this resource from the service. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string accountName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string accountName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.Get"); scope.Start(); diff --git a/samples/Azure.Management.Storage/Generated/FileShareContainer.cs b/samples/Azure.Management.Storage/Generated/FileShareContainer.cs index 7f1b9040855..8a425b7d57e 100644 --- a/samples/Azure.Management.Storage/Generated/FileShareContainer.cs +++ b/samples/Azure.Management.Storage/Generated/FileShareContainer.cs @@ -14,7 +14,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -161,10 +160,10 @@ public async Task StartCreateOrUpdateAsync(string sha } } - /// + /// Gets details for this resource from the service. /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string shareName, CancellationToken cancellationToken = default) + public Response Get(string shareName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("FileShareContainer.Get"); scope.Start(); @@ -185,10 +184,10 @@ public override Response Get(string shareName, CancellationToken canc } } - /// + /// Gets details for this resource from the service. /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string shareName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string shareName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("FileShareContainer.Get"); scope.Start(); diff --git a/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs b/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs index 474e25d41f1..ee8fa09a1fc 100644 --- a/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs +++ b/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs @@ -13,7 +13,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -144,20 +143,15 @@ public async Task StartCreateOrUpdate } } - /// + /// Gets details for this resource from the service. /// The name of the Storage Account Management Policy. It should always be 'default'. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string managementPolicyName, CancellationToken cancellationToken = default) + public Response Get(ManagementPolicyName managementPolicyName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.Get"); scope.Start(); try { - if (managementPolicyName == null) - { - throw new ArgumentNullException(nameof(managementPolicyName)); - } - var response = _restClient.Get(Id.ResourceGroupName, Id.Name, managementPolicyName, cancellationToken: cancellationToken); return Response.FromValue(new ManagementPolicy(Parent, response.Value), response.GetRawResponse()); } @@ -168,20 +162,15 @@ public override Response Get(string managementPolicyName, Canc } } - /// + /// Gets details for this resource from the service. /// The name of the Storage Account Management Policy. It should always be 'default'. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string managementPolicyName, CancellationToken cancellationToken = default) + public async Task> GetAsync(ManagementPolicyName managementPolicyName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.Get"); scope.Start(); try { - if (managementPolicyName == null) - { - throw new ArgumentNullException(nameof(managementPolicyName)); - } - var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Name, managementPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new ManagementPolicy(Parent, response.Value), response.GetRawResponse()); } diff --git a/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs b/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs index 505d7e8e24f..6ce6cdcadd3 100644 --- a/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs +++ b/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs @@ -14,7 +14,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -161,10 +160,10 @@ public async Task StartCreateO } } - /// + /// Gets details for this resource from the service. /// The ID of object replication policy or 'default' if the policy ID is unknown. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string objectReplicationPolicyId, CancellationToken cancellationToken = default) + public Response Get(string objectReplicationPolicyId, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.Get"); scope.Start(); @@ -185,10 +184,10 @@ public override Response Get(string objectReplicationPo } } - /// + /// Gets details for this resource from the service. /// The ID of object replication policy or 'default' if the policy ID is unknown. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string objectReplicationPolicyId, CancellationToken cancellationToken = default) + public async Task> GetAsync(string objectReplicationPolicyId, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.Get"); scope.Start(); diff --git a/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs b/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs index ba95d9b1a0b..45b035b624c 100644 --- a/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs +++ b/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs @@ -13,7 +13,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAsy } } - /// + /// Gets details for this resource from the service. /// The name of the private endpoint connection associated with the Storage Account. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string privateEndpointCo } } - /// + /// Gets details for this resource from the service. /// The name of the private endpoint connection associated with the Storage Account. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.Get"); scope.Start(); diff --git a/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs b/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs index d185b590179..5d49c5387e6 100644 --- a/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs +++ b/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs @@ -14,7 +14,6 @@ using Azure.Core.Pipeline; using Azure.Management.Storage.Models; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.Management.Storage { @@ -161,10 +160,11 @@ public async Task StartCreateOrUpdateAsync(strin } } - /// + /// Gets details for this resource from the service. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string accountName, CancellationToken cancellationToken = default) + public Response Get(string accountName, StorageAccountExpand? expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.Get"); scope.Start(); @@ -175,7 +175,7 @@ public override Response Get(string accountName, CancellationTok throw new ArgumentNullException(nameof(accountName)); } - var response = _restClient.GetProperties(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken); + var response = _restClient.GetProperties(Id.ResourceGroupName, accountName, expand, cancellationToken: cancellationToken); return Response.FromValue(new StorageAccount(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -185,10 +185,11 @@ public override Response Get(string accountName, CancellationTok } } - /// + /// Gets details for this resource from the service. /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string accountName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string accountName, StorageAccountExpand? expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.Get"); scope.Start(); @@ -199,7 +200,7 @@ public async override Task> GetAsync(string accountName throw new ArgumentNullException(nameof(accountName)); } - var response = await _restClient.GetPropertiesAsync(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetPropertiesAsync(Id.ResourceGroupName, accountName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new StorageAccount(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/samples/Azure.ResourceManager.Sample/Azure.ResourceManager.Sample.csproj b/samples/Azure.ResourceManager.Sample/Azure.ResourceManager.Sample.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/samples/Azure.ResourceManager.Sample/Azure.ResourceManager.Sample.csproj +++ b/samples/Azure.ResourceManager.Sample/Azure.ResourceManager.Sample.csproj @@ -11,7 +11,7 @@ - + diff --git a/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs index abd58ff1895..21353eb6b43 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string availabilitySetName, CancellationToken cancellationToken = default) + public Response Get(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string availabilitySetName, Cancel } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); diff --git a/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostContainer.cs index 3a8764df990..7d655b6ad04 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAsyn } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string hostName, CancellationToken cancellationToken = default) + public Response Get(string hostName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string hostName, CancellationToken c } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string hostName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string hostName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostContainer.Get"); scope.Start(); diff --git a/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostGroupContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostGroupContainer.cs index 11e60a61d10..e85b94219f3 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostGroupContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/DedicatedHostGroupContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdat } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host group. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string hostGroupName, CancellationToken cancellationToken = default) + public Response Get(string hostGroupName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostGroupContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string hostGroupName, Cancellat } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host group. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string hostGroupName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string hostGroupName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostGroupContainer.Get"); scope.Start(); diff --git a/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs b/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs index 37a354fc445..a8c56db3586 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/Extensions/SubscriptionExtensions.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { diff --git a/samples/Azure.ResourceManager.Sample/Generated/ImageContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/ImageContainer.cs index 614c6b0651c..1253e157555 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/ImageContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/ImageContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,11 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The name of the image. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string imageName, CancellationToken cancellationToken = default) + public Response Get(string imageName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ImageContainer.Get"); scope.Start(); @@ -174,7 +174,7 @@ public override Response Get(string imageName, CancellationToken cancella throw new ArgumentNullException(nameof(imageName)); } - var response = _restClient.Get(Id.ResourceGroupName, imageName, cancellationToken: cancellationToken); + var response = _restClient.Get(Id.ResourceGroupName, imageName, expand, cancellationToken: cancellationToken); return Response.FromValue(new Image(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -184,10 +184,11 @@ public override Response Get(string imageName, CancellationToken cancella } } - /// + /// Gets details for this resource from the service. /// The name of the image. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string imageName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string imageName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ImageContainer.Get"); scope.Start(); @@ -198,7 +199,7 @@ public async override Task> GetAsync(string imageName, Cancellat throw new ArgumentNullException(nameof(imageName)); } - var response = await _restClient.GetAsync(Id.ResourceGroupName, imageName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.ResourceGroupName, imageName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new Image(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/samples/Azure.ResourceManager.Sample/Generated/ProximityPlacementGroupContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/ProximityPlacementGroupContainer.cs index 755f82cf2ef..59c3b185d29 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/ProximityPlacementGroupContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/ProximityPlacementGroupContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,11 @@ public async Task StartCreateOr } } - /// + /// Gets details for this resource from the service. /// The name of the proximity placement group. + /// includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string proximityPlacementGroupName, CancellationToken cancellationToken = default) + public Response Get(string proximityPlacementGroupName, string includeColocationStatus = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ProximityPlacementGroupContainer.Get"); scope.Start(); @@ -174,7 +174,7 @@ public override Response Get(string proximityPlacementG throw new ArgumentNullException(nameof(proximityPlacementGroupName)); } - var response = _restClient.Get(Id.ResourceGroupName, proximityPlacementGroupName, cancellationToken: cancellationToken); + var response = _restClient.Get(Id.ResourceGroupName, proximityPlacementGroupName, includeColocationStatus, cancellationToken: cancellationToken); return Response.FromValue(new ProximityPlacementGroup(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -184,10 +184,11 @@ public override Response Get(string proximityPlacementG } } - /// + /// Gets details for this resource from the service. /// The name of the proximity placement group. + /// includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string proximityPlacementGroupName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string proximityPlacementGroupName, string includeColocationStatus = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ProximityPlacementGroupContainer.Get"); scope.Start(); @@ -198,7 +199,7 @@ public async override Task> GetAsync(string pr throw new ArgumentNullException(nameof(proximityPlacementGroupName)); } - var response = await _restClient.GetAsync(Id.ResourceGroupName, proximityPlacementGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.ResourceGroupName, proximityPlacementGroupName, includeColocationStatus, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new ProximityPlacementGroup(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/samples/Azure.ResourceManager.Sample/Generated/SshPublicKeyContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/SshPublicKeyContainer.cs index 85a96a82431..8667487ac25 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/SshPublicKeyContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/SshPublicKeyContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The name of the SSH public key. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string sshPublicKeyName, CancellationToken cancellationToken = default) + public Response Get(string sshPublicKeyName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SshPublicKeyContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string sshPublicKeyName, Cancellation } } - /// + /// Gets details for this resource from the service. /// The name of the SSH public key. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string sshPublicKeyName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string sshPublicKeyName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SshPublicKeyContainer.Get"); scope.Start(); diff --git a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineContainer.cs index 22ddd033490..95f96ccea0b 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAsy } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string vmName, CancellationToken cancellationToken = default) + public Response Get(string vmName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string vmName, CancellationToken ca } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string vmName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string vmName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineContainer.Get"); scope.Start(); diff --git a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionContainer.cs index 34de04a90c9..8b708e5782f 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionContainer.cs @@ -13,7 +13,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,11 @@ public async Task StartCreateOr } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine extension. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string vmExtensionName, CancellationToken cancellationToken = default) + public Response Get(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionContainer.Get"); scope.Start(); @@ -174,7 +174,7 @@ public override Response Get(string vmExtensionName, Ca throw new ArgumentNullException(nameof(vmExtensionName)); } - var response = _restClient.Get(Id.ResourceGroupName, Id.Name, vmExtensionName, cancellationToken: cancellationToken); + var response = _restClient.Get(Id.ResourceGroupName, Id.Name, vmExtensionName, expand, cancellationToken: cancellationToken); return Response.FromValue(new VirtualMachineExtension(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -184,10 +184,11 @@ public override Response Get(string vmExtensionName, Ca } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine extension. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string vmExtensionName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionContainer.Get"); scope.Start(); @@ -198,7 +199,7 @@ public async override Task> GetAsync(string vm throw new ArgumentNullException(nameof(vmExtensionName)); } - var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Name, vmExtensionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Name, vmExtensionName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new VirtualMachineExtension(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionVirtualMachineScaleSetsContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionVirtualMachineScaleSetsContainer.cs index 327f59b317f..062448bdc4d 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionVirtualMachineScaleSetsContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineExtensionVirtualMachineScaleSetsContainer.cs @@ -13,7 +13,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,11 @@ public async Task Sta } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine extension. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string vmExtensionName, CancellationToken cancellationToken = default) + public Response Get(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionVirtualMachineScaleSetsContainer.Get"); scope.Start(); @@ -174,7 +174,7 @@ public override Response Get(string vmExtensionName, Ca throw new ArgumentNullException(nameof(vmExtensionName)); } - var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, Id.Name, vmExtensionName, cancellationToken: cancellationToken); + var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, Id.Name, vmExtensionName, expand, cancellationToken: cancellationToken); return Response.FromValue(new VirtualMachineExtension(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -184,10 +184,11 @@ public override Response Get(string vmExtensionName, Ca } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine extension. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string vmExtensionName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string vmExtensionName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionVirtualMachineScaleSetsContainer.Get"); scope.Start(); @@ -198,7 +199,7 @@ public async override Task> GetAsync(string vm throw new ArgumentNullException(nameof(vmExtensionName)); } - var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Name, Id.Name, vmExtensionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Name, Id.Name, vmExtensionName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new VirtualMachineExtension(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetContainer.cs index f59f3e31aa6..e50077f991d 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,10 @@ public async Task StartCreateOrU } } - /// + /// Gets details for this resource from the service. /// The name of the VM scale set. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string vmScaleSetName, CancellationToken cancellationToken = default) + public Response Get(string vmScaleSetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string vmScaleSetName, Canc } } - /// + /// Gets details for this resource from the service. /// The name of the VM scale set. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string vmScaleSetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string vmScaleSetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetContainer.Get"); scope.Start(); diff --git a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetExtensionContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetExtensionContainer.cs index 3532869a9b5..c0b66eeffd7 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetExtensionContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetExtensionContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,11 @@ public async Task Start } } - /// + /// Gets details for this resource from the service. /// The name of the VM scale set extension. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string vmssExtensionName, CancellationToken cancellationToken = default) + public Response Get(string vmssExtensionName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetExtensionContainer.Get"); scope.Start(); @@ -174,7 +174,7 @@ public override Response Get(string vmssExtensi throw new ArgumentNullException(nameof(vmssExtensionName)); } - var response = _restClient.Get(Id.ResourceGroupName, Id.Name, vmssExtensionName, cancellationToken: cancellationToken); + var response = _restClient.Get(Id.ResourceGroupName, Id.Name, vmssExtensionName, expand, cancellationToken: cancellationToken); return Response.FromValue(new VirtualMachineScaleSetExtension(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -184,10 +184,11 @@ public override Response Get(string vmssExtensi } } - /// + /// Gets details for this resource from the service. /// The name of the VM scale set extension. + /// The expand expression to apply on the operation. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string vmssExtensionName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string vmssExtensionName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetExtensionContainer.Get"); scope.Start(); @@ -198,7 +199,7 @@ public async override Task> GetAsync(s throw new ArgumentNullException(nameof(vmssExtensionName)); } - var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Name, vmssExtensionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Name, vmssExtensionName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new VirtualMachineScaleSetExtension(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetVMContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetVMContainer.cs index c239ce42c26..8ef43ee7cd0 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetVMContainer.cs +++ b/samples/Azure.ResourceManager.Sample/Generated/VirtualMachineScaleSetVMContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace Azure.ResourceManager.Sample { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateA } } - /// + /// Gets details for this resource from the service. /// The instance ID of the virtual machine. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string instanceId, CancellationToken cancellationToken = default) + public Response Get(string instanceId, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string instanceId, Cancel } } - /// + /// Gets details for this resource from the service. /// The instance ID of the virtual machine. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string instanceId, CancellationToken cancellationToken = default) + public async Task> GetAsync(string instanceId, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineScaleSetVMContainer.Get"); scope.Start(); diff --git a/src/AutoRest.CSharp/AutoRest.CSharp.csproj b/src/AutoRest.CSharp/AutoRest.CSharp.csproj index ddc98e822cc..5a26df0ced7 100644 --- a/src/AutoRest.CSharp/AutoRest.CSharp.csproj +++ b/src/AutoRest.CSharp/AutoRest.CSharp.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpProj.cs b/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpProj.cs index 9e09bf43903..1e2d8c69c2f 100644 --- a/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpProj.cs +++ b/src/AutoRest.CSharp/Common/AutoRest/Plugins/CSharpProj.cs @@ -37,7 +37,7 @@ internal class CSharpProj : IPlugin - + "; diff --git a/src/AutoRest.CSharp/Mgmt/Generation/MgmtClientBaseWriter.cs b/src/AutoRest.CSharp/Mgmt/Generation/MgmtClientBaseWriter.cs index c2fc10abc42..48cbfba2197 100644 --- a/src/AutoRest.CSharp/Mgmt/Generation/MgmtClientBaseWriter.cs +++ b/src/AutoRest.CSharp/Mgmt/Generation/MgmtClientBaseWriter.cs @@ -359,7 +359,12 @@ protected void WriteClientMethod(CodeWriter writer, RestClientMethod clientMetho if (isResourceList) { - writer.Append($"return Response.FromValue(response.Value.Value.Select(data => new {context.Library.GetArmResource(operationGroup).Declaration.Name}({ContextProperty}, data)), response.GetRawResponse())"); + writer.Append($"return Response.FromValue(response.Value."); + if (isResourceListResultType(clientMethod.ReturnType)) + { + writer.Append($"Value."); + } + writer.Append($"Select(data => new {context.Library.GetArmResource(operationGroup).Declaration.Name}({ContextProperty}, data)), response.GetRawResponse())"); } else { @@ -378,6 +383,11 @@ protected void WriteClientMethod(CodeWriter writer, RestClientMethod clientMetho writer.Line(); } + private bool isResourceListResultType(CSharpType? type) + { + return type != null && !type.IsFrameworkType && type.Implementation is SchemaObjectType schemaObject; + } + private CSharpType? GetBodyTypeForList(CSharpType? returnType, OperationGroup operationGroup, BuildContext context) { if (returnType == null) @@ -386,8 +396,13 @@ protected void WriteClientMethod(CodeWriter writer, RestClientMethod clientMetho var result = returnType; var resourceData = context.Library.GetResourceData(operationGroup); + var areTypesEqual = AreTypesEqual(returnType, new CSharpType(typeof(IReadOnlyList<>), resourceData.Type)); + if (areTypesEqual) + { + return new CSharpType(typeof(IEnumerable<>), context.Library.GetArmResource(operationGroup).Type); + } - if (resourceData != null && !returnType.IsFrameworkType && returnType.Implementation is SchemaObjectType schemaObject) + if (resourceData != null && isResourceListResultType(returnType) && returnType.Implementation is SchemaObjectType schemaObject) { var valueProperty = schemaObject.Properties.FirstOrDefault(p => p.Declaration.Name == "Value" && AreTypesEqual(p.Declaration.Type, new CSharpType(typeof(IReadOnlyList<>), resourceData.Type))); @@ -492,6 +507,13 @@ private void BuildPathParameterNames(List paramNames, int paramLength, s { if (IsTerminalState(operationGroup, context) && paramLength == 1) { + if (operationGroup.IsTupleResource(context)) + { + name = $"{name}.Parent"; + paramNames.Add($"{name}.Name"); + paramLength--; + return; + } paramNames.Add(GetParentValue(operationGroup, context)); paramLength--; } diff --git a/src/AutoRest.CSharp/Mgmt/Generation/ResourceContainerWriter.cs b/src/AutoRest.CSharp/Mgmt/Generation/ResourceContainerWriter.cs index f12a636202a..9fec64969a7 100644 --- a/src/AutoRest.CSharp/Mgmt/Generation/ResourceContainerWriter.cs +++ b/src/AutoRest.CSharp/Mgmt/Generation/ResourceContainerWriter.cs @@ -18,7 +18,6 @@ using Azure; using Azure.Core; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace AutoRest.CSharp.Mgmt.Generation { @@ -261,35 +260,14 @@ private void WriteContainerMethodScope(bool isAsync, FormattableString returnTyp private void WriteGetVariants(RestClientMethod method) { var parameterMapping = BuildParameterMapping(method); - // some Get() contains extra non-name parameters which if added to method signature, - // would break the inheritance to ResourceContainerBase - // e.g. `expand` when getting image in compute RP - parameterMapping = parameterMapping.Where(mapping => IsMandatory(mapping.Parameter)); var methodName = "Get"; var scopeName = methodName; - IEnumerable passThruParameters = parameterMapping.Where(p => p.IsPassThru).Select(parameter => - { - if (parameter.Parameter.Type.IsStringLike()) - { - // for string-like parameters, we shall write them as string as base class - return new Parameter( - parameter.Parameter.Name, - parameter.Parameter.Description, - new CSharp.Generation.Types.CSharpType(typeof(string)), - parameter.Parameter.DefaultValue, - parameter.Parameter.ValidateNotNull, - parameter.Parameter.IsApiVersionParameter - ); - } - else - { - return parameter.Parameter; - } - }); + IEnumerable passThruParameters = parameterMapping.Where(p => p.IsPassThru).Select(p => p.Parameter); _writer.Line(); + _writer.WriteXmlDocumentationSummary($"Gets details for this resource from the service."); WriteContainerMethodScope(false, $"{typeof(Response)}<{_resource.Type.Name}>", "Get", passThruParameters, writer => { _writer.Append($"var response = {RestClientField}.{method.Name}("); @@ -300,9 +278,10 @@ private void WriteGetVariants(RestClientMethod method) } _writer.Line($"cancellationToken: cancellationToken);"); _writer.Line($"return {typeof(Response)}.FromValue(new {_resource.Type}({_parentProperty}, response.Value), response.GetRawResponse());"); - }, isOverride: GetBaseType() != "ContainerBase"); + }, isOverride: false); _writer.Line(); + _writer.WriteXmlDocumentationSummary($"Gets details for this resource from the service."); WriteContainerMethodScope(true, $"{typeof(Task)}<{typeof(Response)}<{_resource.Type.Name}>>", "Get", passThruParameters, writer => { _writer.Append($"var response = await {RestClientField}.{method.Name}Async("); @@ -313,7 +292,7 @@ private void WriteGetVariants(RestClientMethod method) } _writer.Line($"cancellationToken: cancellationToken).ConfigureAwait(false);"); _writer.Line($"return {typeof(Response)}.FromValue(new {_resource.Type}({_parentProperty}, response.Value), response.GetRawResponse());"); - }, isOverride: GetBaseType() != "ContainerBase"); + }, isOverride: false); } private void WriteListVariants() diff --git a/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs b/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs index af61c447868..1631f314910 100644 --- a/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs +++ b/src/AutoRest.CSharp/Mgmt/Generation/SubscriptionExtensionsWriter.cs @@ -20,7 +20,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace AutoRest.CSharp.Generation.Writers { diff --git a/src/AutoRest.CSharp/Mgmt/Generation/TupleResourceContainerWriter.cs b/src/AutoRest.CSharp/Mgmt/Generation/TupleResourceContainerWriter.cs index 8dcf2e7547a..598523e98cb 100644 --- a/src/AutoRest.CSharp/Mgmt/Generation/TupleResourceContainerWriter.cs +++ b/src/AutoRest.CSharp/Mgmt/Generation/TupleResourceContainerWriter.cs @@ -20,11 +20,6 @@ public TupleResourceContainerWriter(CodeWriter writer, ResourceContainer resourc { } - protected override string GetBaseType() - { - return "ContainerBase"; - } - protected override bool ShouldPassThrough(ref string dotParent, Stack parentNameStack, Parameter parameter, ref string valueExpression) { return true; diff --git a/test/AutoRest.Shared.Tests/AutoRest.Shared.Tests.csproj b/test/AutoRest.Shared.Tests/AutoRest.Shared.Tests.csproj index 028d49a2447..05112a53fb6 100644 --- a/test/AutoRest.Shared.Tests/AutoRest.Shared.Tests.csproj +++ b/test/AutoRest.Shared.Tests/AutoRest.Shared.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/test/AutoRest.TestServer.Tests/AutoRest.TestServer.Tests.csproj b/test/AutoRest.TestServer.Tests/AutoRest.TestServer.Tests.csproj index 1b96abfa1b3..71407e4e2d5 100644 --- a/test/AutoRest.TestServer.Tests/AutoRest.TestServer.Tests.csproj +++ b/test/AutoRest.TestServer.Tests/AutoRest.TestServer.Tests.csproj @@ -8,10 +8,10 @@ - + - + diff --git a/test/TestProjects/ExactMatchFlattenInheritance/ExactMatchFlattenInheritance.csproj b/test/TestProjects/ExactMatchFlattenInheritance/ExactMatchFlattenInheritance.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/ExactMatchFlattenInheritance.csproj +++ b/test/TestProjects/ExactMatchFlattenInheritance/ExactMatchFlattenInheritance.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel1Container.cs b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel1Container.cs index d6c3bde720e..53a748a7675 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel1Container.cs +++ b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string name, CancellationToken cancellationToken = default) + public Response Get(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string name, Cancellati } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string name, CancellationToken cancellationToken = default) + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel2Container.cs b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel2Container.cs index ca20db54647..a56dd00cae1 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel2Container.cs +++ b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel2Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string name, CancellationToken cancellationToken = default) + public Response Get(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel2Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string name, Cancellati } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string name, CancellationToken cancellationToken = default) + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel2Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel3Container.cs b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel3Container.cs index d637fd9231d..7fa55c086e6 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel3Container.cs +++ b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel3Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string name, CancellationToken cancellationToken = default) + public Response Get(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel3Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string name, Cancellati } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string name, CancellationToken cancellationToken = default) + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel3Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel4Container.cs b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel4Container.cs index b7cb4b07a70..176ea13270d 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel4Container.cs +++ b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel4Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string name, CancellationToken cancellationToken = default) + public Response Get(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel4Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string name, Cancellati } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string name, CancellationToken cancellationToken = default) + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel4Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel5Container.cs b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel5Container.cs index 3c771cd0427..06d4476aa70 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel5Container.cs +++ b/test/TestProjects/ExactMatchFlattenInheritance/Generated/AzureResourceFlattenModel5Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchFlattenInheritance { @@ -143,10 +142,10 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string name, CancellationToken cancellationToken = default) + public Response Get(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel5Container.Get"); scope.Start(); @@ -167,10 +166,10 @@ public override Response Get(string name, Cancellati } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string name, CancellationToken cancellationToken = default) + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AzureResourceFlattenModel5Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel2Container.cs b/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel2Container.cs index 8a981935e08..07f97bc0e5d 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel2Container.cs +++ b/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel2Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchFlattenInheritance { @@ -143,10 +142,10 @@ public async Task StartCreateOrUpdateAsync(string nam } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string name, CancellationToken cancellationToken = default) + public Response Get(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel2Container.Get"); scope.Start(); @@ -167,10 +166,10 @@ public override Response Get(string name, CancellationToken cancel } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string name, CancellationToken cancellationToken = default) + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel2Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel3Container.cs b/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel3Container.cs index 12352e1d59e..38b695b7ce5 100644 --- a/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel3Container.cs +++ b/test/TestProjects/ExactMatchFlattenInheritance/Generated/CustomModel3Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string nam } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string name, CancellationToken cancellationToken = default) + public Response Get(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel3Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string name, CancellationToken cancel } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string name, CancellationToken cancellationToken = default) + public async Task> GetAsync(string name, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel3Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchInheritance/ExactMatchInheritance.csproj b/test/TestProjects/ExactMatchInheritance/ExactMatchInheritance.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/ExactMatchInheritance/ExactMatchInheritance.csproj +++ b/test/TestProjects/ExactMatchInheritance/ExactMatchInheritance.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel1Container.cs b/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel1Container.cs index 057397e73a5..16e179ae6aa 100644 --- a/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel1Container.cs +++ b/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string exactMatchModel1SName, CancellationToken cancellationToken = default) + public Response Get(string exactMatchModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ExactMatchModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string exactMatchModel1SName, Can } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string exactMatchModel1SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string exactMatchModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ExactMatchModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel3Container.cs b/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel3Container.cs index 0750e154451..531f889628d 100644 --- a/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel3Container.cs +++ b/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel3Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string exactMatchModel3SName, CancellationToken cancellationToken = default) + public Response Get(string exactMatchModel3SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ExactMatchModel3Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string exactMatchModel3SName, Can } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string exactMatchModel3SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string exactMatchModel3SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ExactMatchModel3Container.Get"); scope.Start(); diff --git a/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel5Container.cs b/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel5Container.cs index bb536dfd67a..3e1ba906dcb 100644 --- a/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel5Container.cs +++ b/test/TestProjects/ExactMatchInheritance/Generated/ExactMatchModel5Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ExactMatchInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string exactMatchModel5SName, CancellationToken cancellationToken = default) + public Response Get(string exactMatchModel5SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ExactMatchModel5Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string exactMatchModel5SName, Can } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string exactMatchModel5SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string exactMatchModel5SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ExactMatchModel5Container.Get"); scope.Start(); diff --git a/test/TestProjects/MgmtOperations/Generated/AvailabilitySetChildContainer.cs b/test/TestProjects/MgmtOperations/Generated/AvailabilitySetChildContainer.cs index 83a079c8c13..ed78d1df89e 100644 --- a/test/TestProjects/MgmtOperations/Generated/AvailabilitySetChildContainer.cs +++ b/test/TestProjects/MgmtOperations/Generated/AvailabilitySetChildContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; using MgmtOperations.Models; namespace MgmtOperations @@ -160,10 +159,10 @@ public async Task StartCreateOrUpda } } - /// + /// Gets details for this resource from the service. /// The name of the availability set child. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string availabilitySetChildName, CancellationToken cancellationToken = default) + public Response Get(string availabilitySetChildName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetChildContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string availabilitySetChildNa } } - /// + /// Gets details for this resource from the service. /// The name of the availability set child. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string availabilitySetChildName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string availabilitySetChildName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetChildContainer.Get"); scope.Start(); diff --git a/test/TestProjects/MgmtOperations/Generated/AvailabilitySetContainer.cs b/test/TestProjects/MgmtOperations/Generated/AvailabilitySetContainer.cs index bb51907443c..c2eb98b3b2a 100644 --- a/test/TestProjects/MgmtOperations/Generated/AvailabilitySetContainer.cs +++ b/test/TestProjects/MgmtOperations/Generated/AvailabilitySetContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; using MgmtOperations.Models; namespace MgmtOperations @@ -160,10 +159,11 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. + /// May be used to expand the participants. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string availabilitySetName, CancellationToken cancellationToken = default) + public Response Get(string availabilitySetName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); @@ -174,7 +174,7 @@ public override Response Get(string availabilitySetName, Cancel throw new ArgumentNullException(nameof(availabilitySetName)); } - var response = _restClient.Get(Id.ResourceGroupName, availabilitySetName, cancellationToken: cancellationToken); + var response = _restClient.Get(Id.ResourceGroupName, availabilitySetName, expand, cancellationToken: cancellationToken); return Response.FromValue(new AvailabilitySet(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -184,10 +184,11 @@ public override Response Get(string availabilitySetName, Cancel } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. + /// May be used to expand the participants. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string availabilitySetName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); @@ -198,7 +199,7 @@ public async override Task> GetAsync(string availabili throw new ArgumentNullException(nameof(availabilitySetName)); } - var response = await _restClient.GetAsync(Id.ResourceGroupName, availabilitySetName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.ResourceGroupName, availabilitySetName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new AvailabilitySet(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/test/TestProjects/MgmtOperations/Generated/AvailabilitySetGrandChildContainer.cs b/test/TestProjects/MgmtOperations/Generated/AvailabilitySetGrandChildContainer.cs index 2a322894f08..faa830f8d4a 100644 --- a/test/TestProjects/MgmtOperations/Generated/AvailabilitySetGrandChildContainer.cs +++ b/test/TestProjects/MgmtOperations/Generated/AvailabilitySetGrandChildContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; using MgmtOperations.Models; namespace MgmtOperations @@ -160,10 +159,10 @@ public async Task StartCreateO } } - /// + /// Gets details for this resource from the service. /// The name of the availability set grand child. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string availabilitySetGrandChildName, CancellationToken cancellationToken = default) + public Response Get(string availabilitySetGrandChildName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetGrandChildContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string availabilitySetGr } } - /// + /// Gets details for this resource from the service. /// The name of the availability set grand child. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string availabilitySetGrandChildName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string availabilitySetGrandChildName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetGrandChildContainer.Get"); scope.Start(); diff --git a/test/TestProjects/MgmtOperations/MgmtOperations.csproj b/test/TestProjects/MgmtOperations/MgmtOperations.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/MgmtOperations/MgmtOperations.csproj +++ b/test/TestProjects/MgmtOperations/MgmtOperations.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs b/test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs index 556e2ba045f..d64529fc6be 100644 --- a/test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs +++ b/test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace MgmtParent { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAs } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string availabilitySetName, CancellationToken cancellationToken = default) + public Response Get(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string availabilitySetName, Cancel } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs index f5117a3c35a..cd8f8a8b7a5 100644 --- a/test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace MgmtParent { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAsyn } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string hostName, CancellationToken cancellationToken = default) + public Response Get(string hostName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string hostName, CancellationToken c } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string hostName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string hostName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostContainer.Get"); scope.Start(); diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs index a9b34c95061..a6968d9f049 100644 --- a/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace MgmtParent { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdat } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host group. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string hostGroupName, CancellationToken cancellationToken = default) + public Response Get(string hostGroupName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostGroupContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string hostGroupName, Cancellat } } - /// + /// Gets details for this resource from the service. /// The name of the dedicated host group. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string hostGroupName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string hostGroupName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DedicatedHostGroupContainer.Get"); scope.Start(); diff --git a/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs b/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs index e052a2e4580..b14986e194c 100644 --- a/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs +++ b/test/TestProjects/MgmtParent/Generated/Extensions/SubscriptionExtensions.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace MgmtParent { diff --git a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs index 3def90e762c..3f316d92b4b 100644 --- a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs +++ b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs @@ -13,12 +13,11 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace MgmtParent { /// A class representing collection of VirtualMachineExtensionImage and their operations over a Subscription. - public partial class VirtualMachineExtensionImageContainer : ContainerBase + public partial class VirtualMachineExtensionImageContainer : ResourceContainerBase { /// Initializes a new instance of the class for mocking. protected VirtualMachineExtensionImageContainer() @@ -220,6 +219,7 @@ public async Task StartCre } } + /// Gets details for this resource from the service. /// The name of a supported Azure region. /// The String to use. /// The String to use. @@ -258,6 +258,7 @@ public Response Get(string location, string publis } } + /// Gets details for this resource from the service. /// The name of a supported Azure region. /// The String to use. /// The String to use. @@ -342,14 +343,14 @@ public AsyncPageable ListAsGenericResourceAsync(string nameFilt /// Gets a list of virtual machine extension image types. /// The cancellation token to use. - public virtual async Task>> ListTypesAsync(CancellationToken cancellationToken = default) + public virtual async Task>> ListTypesAsync(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionImageContainer.ListTypes"); scope.Start(); try { - var response = await _restClient.ListTypesAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - return response; + var response = await _restClient.ListTypesAsync(Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value.Select(data => new VirtualMachineExtensionImage(Parent, data)), response.GetRawResponse()); } catch (Exception e) { @@ -360,14 +361,14 @@ public virtual async Task Gets a list of virtual machine extension image types. /// The cancellation token to use. - public virtual Response> ListTypes(CancellationToken cancellationToken = default) + public virtual Response> ListTypes(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionImageContainer.ListTypes"); scope.Start(); try { - var response = _restClient.ListTypes(Id.SubscriptionId, Id.Name, cancellationToken); - return response; + var response = _restClient.ListTypes(Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(response.Value.Select(data => new VirtualMachineExtensionImage(Parent, data)), response.GetRawResponse()); } catch (Exception e) { @@ -381,14 +382,14 @@ public virtual Response> ListTyp /// The Integer to use. /// The String to use. /// The cancellation token to use. - public virtual async Task>> ListVersionsAsync(string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) + public virtual async Task>> ListVersionsAsync(string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionImageContainer.ListVersions"); scope.Start(); try { - var response = await _restClient.ListVersionsAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, filter, top, orderby, cancellationToken).ConfigureAwait(false); - return response; + var response = await _restClient.ListVersionsAsync(Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, top, orderby, cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value.Select(data => new VirtualMachineExtensionImage(Parent, data)), response.GetRawResponse()); } catch (Exception e) { @@ -402,14 +403,14 @@ public virtual async Task The Integer to use. /// The String to use. /// The cancellation token to use. - public virtual Response> ListVersions(string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) + public virtual Response> ListVersions(string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualMachineExtensionImageContainer.ListVersions"); scope.Start(); try { - var response = _restClient.ListVersions(Id.SubscriptionId, Id.Parent.Name, Id.Name, filter, top, orderby, cancellationToken); - return response; + var response = _restClient.ListVersions(Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, filter, top, orderby, cancellationToken); + return Response.FromValue(response.Value.Select(data => new VirtualMachineExtensionImage(Parent, data)), response.GetRawResponse()); } catch (Exception e) { diff --git a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs index 263f0a1b6dc..a1eef0a3d59 100644 --- a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs +++ b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs @@ -46,7 +46,7 @@ public async override Task> GetAsync(Canc scope.Start(); try { - var response = await _restClient.GetAsync(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new VirtualMachineExtensionImage(this, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -63,7 +63,7 @@ public override Response Get(CancellationToken can scope.Start(); try { - var response = _restClient.Get(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var response = _restClient.Get(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new VirtualMachineExtensionImage(this, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -153,7 +153,7 @@ public async Task StartAdd var patchable = new VirtualMachineExtensionImageData(locationData); patchable.Tags.ReplaceWith(resource.Data.Tags); patchable.Tags[key] = value; - var response = await _restClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken).ConfigureAwait(false); + var response = await _restClient.CreateOrUpdateAsync(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken).ConfigureAwait(false); return new VirtualMachineExtensionImagesCreateOrUpdateOperation(this, response); } catch (Exception e) @@ -185,7 +185,7 @@ public VirtualMachineExtensionImagesCreateOrUpdateOperation StartAddTag(string k var patchable = new VirtualMachineExtensionImageData(locationData); patchable.Tags.ReplaceWith(resource.Data.Tags); patchable.Tags[key] = value; - var response = _restClient.CreateOrUpdate(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken); + var response = _restClient.CreateOrUpdate(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken); return new VirtualMachineExtensionImagesCreateOrUpdateOperation(this, response); } catch (Exception e) @@ -254,7 +254,7 @@ public async Task StartSet Id.TryGetLocation(out LocationData locationData); var patchable = new VirtualMachineExtensionImageData(locationData); patchable.Tags.ReplaceWith(tags); - var response = await _restClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken).ConfigureAwait(false); + var response = await _restClient.CreateOrUpdateAsync(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken).ConfigureAwait(false); return new VirtualMachineExtensionImagesCreateOrUpdateOperation(this, response); } catch (Exception e) @@ -283,7 +283,7 @@ public VirtualMachineExtensionImagesCreateOrUpdateOperation StartSetTags(IDictio Id.TryGetLocation(out LocationData locationData); var patchable = new VirtualMachineExtensionImageData(locationData); patchable.Tags.ReplaceWith(tags); - var response = _restClient.CreateOrUpdate(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken); + var response = _restClient.CreateOrUpdate(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken); return new VirtualMachineExtensionImagesCreateOrUpdateOperation(this, response); } catch (Exception e) @@ -354,7 +354,7 @@ public async Task StartRem var patchable = new VirtualMachineExtensionImageData(locationData); patchable.Tags.ReplaceWith(resource.Data.Tags); patchable.Tags.Remove(key); - var response = await _restClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken).ConfigureAwait(false); + var response = await _restClient.CreateOrUpdateAsync(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken).ConfigureAwait(false); return new VirtualMachineExtensionImagesCreateOrUpdateOperation(this, response); } catch (Exception e) @@ -385,7 +385,7 @@ public VirtualMachineExtensionImagesCreateOrUpdateOperation StartRemoveTag(strin var patchable = new VirtualMachineExtensionImageData(locationData); patchable.Tags.ReplaceWith(resource.Data.Tags); patchable.Tags.Remove(key); - var response = _restClient.CreateOrUpdate(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken); + var response = _restClient.CreateOrUpdate(Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patchable, cancellationToken); return new VirtualMachineExtensionImagesCreateOrUpdateOperation(this, response); } catch (Exception e) diff --git a/test/TestProjects/MgmtParent/MgmtParent.csproj b/test/TestProjects/MgmtParent/MgmtParent.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/MgmtParent/MgmtParent.csproj +++ b/test/TestProjects/MgmtParent/MgmtParent.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/MgmtSingleton/Generated/ParentResourceContainer.cs b/test/TestProjects/MgmtSingleton/Generated/ParentResourceContainer.cs index 3e86bf786e7..bbe1afb942c 100644 --- a/test/TestProjects/MgmtSingleton/Generated/ParentResourceContainer.cs +++ b/test/TestProjects/MgmtSingleton/Generated/ParentResourceContainer.cs @@ -13,7 +13,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace MgmtSingleton { @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAsy } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string parentName, CancellationToken cancellationToken = default) + public Response Get(string parentName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ParentResourceContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string parentName, CancellationToke } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string parentName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string parentName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ParentResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/MgmtSingleton/MgmtSingleton.csproj b/test/TestProjects/MgmtSingleton/MgmtSingleton.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/MgmtSingleton/MgmtSingleton.csproj +++ b/test/TestProjects/MgmtSingleton/MgmtSingleton.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/OperationGroupMappings/Generated/AvailabilitySetContainer.cs b/test/TestProjects/OperationGroupMappings/Generated/AvailabilitySetContainer.cs index 740999a1f8c..9afb71c2251 100644 --- a/test/TestProjects/OperationGroupMappings/Generated/AvailabilitySetContainer.cs +++ b/test/TestProjects/OperationGroupMappings/Generated/AvailabilitySetContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace OperationGroupMappings { @@ -44,10 +43,10 @@ internal AvailabilitySetContainer(ResourceOperationsBase parent) : base(parent) // Container level operations. - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string availabilitySetName, CancellationToken cancellationToken = default) + public Response Get(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); @@ -68,10 +67,10 @@ public override Response Get(string availabilitySetName, Cancel } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get"); scope.Start(); diff --git a/test/TestProjects/OperationGroupMappings/OperationGroupMappings.csproj b/test/TestProjects/OperationGroupMappings/OperationGroupMappings.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/OperationGroupMappings/OperationGroupMappings.csproj +++ b/test/TestProjects/OperationGroupMappings/OperationGroupMappings.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/ModelDataContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/ModelDataContainer.cs index 129c0b23ca6..f53ce482de2 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/ModelDataContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/ModelDataContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string modelD } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string modelDatasName, CancellationToken cancellationToken = default) + public Response Get(string modelDatasName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ModelDataContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string modelDatasName, CancellationToken } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string modelDatasName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string modelDatasName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ModelDataContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceGroupResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceGroupResourceContainer.cs index 40bed3d2a25..1f2ce752eb3 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceGroupResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceGroupResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(s } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string resourceGroupResourcesName, CancellationToken cancellationToken = default) + public Response Get(string resourceGroupResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceGroupResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string resourceGroupResource } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string resourceGroupResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceGroupResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceGroupResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceLevelContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceLevelContainer.cs index 30041d54572..58c211a4010 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceLevelContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/ResourceLevelContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string re } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string resourceLevelsName, CancellationToken cancellationToken = default) + public Response Get(string resourceLevelsName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceLevelContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string resourceLevelsName, Cancellat } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string resourceLevelsName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceLevelsName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceLevelContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes2ResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes2ResourceContainer.cs index 85a7830cd04..5332cffa86d 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes2ResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes2ResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string subRes2ResourcesName, CancellationToken cancellationToken = default) + public Response Get(string subRes2ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubRes2ResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string subRes2ResourcesName, Cance } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string subRes2ResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subRes2ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubRes2ResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes3ResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes3ResourceContainer.cs index b7d5fd49e08..3a6e84a0f81 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes3ResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/SubRes3ResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string subRes3ResourcesName, CancellationToken cancellationToken = default) + public Response Get(string subRes3ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubRes3ResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string subRes3ResourcesName, Cance } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string subRes3ResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subRes3ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubRes3ResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/SubResResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/SubResResourceContainer.cs index b12f5a938ae..d5da593a093 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/SubResResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/SubResResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string s } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string subResResourcesName, CancellationToken cancellationToken = default) + public Response Get(string subResResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubResResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string subResResourcesName, Cancell } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string subResResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subResResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubResResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/SubscriptionLevelResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/SubscriptionLevelResourceContainer.cs index 0a53e9697ad..a01e5c9b2b4 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/SubscriptionLevelResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/SubscriptionLevelResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsy } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string subscriptionLevelResourcesName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionLevelResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubscriptionLevelResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string subscriptionLevel } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string subscriptionLevelResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionLevelResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubscriptionLevelResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/TenantLevelResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/TenantLevelResourceContainer.cs index 4a017093127..616e5c9d2b2 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/TenantLevelResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/TenantLevelResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(str } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string tenantLevelResourcesName, CancellationToken cancellationToken = default) + public Response Get(string tenantLevelResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("TenantLevelResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string tenantLevelResourcesNam } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string tenantLevelResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string tenantLevelResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("TenantLevelResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes2ResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes2ResourceContainer.cs index b60e64d32ae..da33956204c 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes2ResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes2ResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string writableSubRes2ResourcesName, CancellationToken cancellationToken = default) + public Response Get(string writableSubRes2ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubRes2ResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string writableSubRes2Reso } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string writableSubRes2ResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string writableSubRes2ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubRes2ResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes3ResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes3ResourceContainer.cs index 284ac993044..62f180865d0 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes3ResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubRes3ResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string writableSubRes3ResourcesName, CancellationToken cancellationToken = default) + public Response Get(string writableSubRes3ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubRes3ResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string writableSubRes3Reso } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string writableSubRes3ResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string writableSubRes3ResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubRes3ResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubResResourceContainer.cs b/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubResResourceContainer.cs index 6133a625237..034f700be95 100644 --- a/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubResResourceContainer.cs +++ b/test/TestProjects/ResourceIdentifierChooser/Generated/WritableSubResResourceContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace ResourceIdentifierChooser { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync( } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string writableSubResResourcesName, CancellationToken cancellationToken = default) + public Response Get(string writableSubResResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubResResourceContainer.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string writableSubResResour } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string writableSubResResourcesName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string writableSubResResourcesName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubResResourceContainer.Get"); scope.Start(); diff --git a/test/TestProjects/ResourceIdentifierChooser/ResourceIdentifierChooser.csproj b/test/TestProjects/ResourceIdentifierChooser/ResourceIdentifierChooser.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/ResourceIdentifierChooser/ResourceIdentifierChooser.csproj +++ b/test/TestProjects/ResourceIdentifierChooser/ResourceIdentifierChooser.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/ResourceRename/ResourceRename.csproj b/test/TestProjects/ResourceRename/ResourceRename.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/ResourceRename/ResourceRename.csproj +++ b/test/TestProjects/ResourceRename/ResourceRename.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs b/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs index c0a288ae638..6e2c8a01949 100644 --- a/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs +++ b/test/TestProjects/SubscriptionExtensions/Generated/Extensions/SubscriptionExtensions.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SubscriptionExtensions { diff --git a/test/TestProjects/SubscriptionExtensions/Generated/OvenContainer.cs b/test/TestProjects/SubscriptionExtensions/Generated/OvenContainer.cs index ce2491c690d..bebea3f90e2 100644 --- a/test/TestProjects/SubscriptionExtensions/Generated/OvenContainer.cs +++ b/test/TestProjects/SubscriptionExtensions/Generated/OvenContainer.cs @@ -13,7 +13,6 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; using SubscriptionExtensions.Models; namespace SubscriptionExtensions @@ -161,10 +160,10 @@ public async Task StartCreateOrUpdateAsync(string } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string vmName, CancellationToken cancellationToken = default) + public Response Get(string vmName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("OvenContainer.Get"); scope.Start(); @@ -185,10 +184,10 @@ public override Response Get(string vmName, CancellationToken cancellation } } - /// + /// Gets details for this resource from the service. /// The name of the virtual machine. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string vmName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string vmName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("OvenContainer.Get"); scope.Start(); diff --git a/test/TestProjects/SubscriptionExtensions/Generated/ToasterContainer.cs b/test/TestProjects/SubscriptionExtensions/Generated/ToasterContainer.cs index 1816e7a68b8..3e878e6e1d8 100644 --- a/test/TestProjects/SubscriptionExtensions/Generated/ToasterContainer.cs +++ b/test/TestProjects/SubscriptionExtensions/Generated/ToasterContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; using SubscriptionExtensions.Models; namespace SubscriptionExtensions @@ -160,10 +159,10 @@ public async Task StartCreateOrUpdateAsync(stri } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string availabilitySetName, CancellationToken cancellationToken = default) + public Response Get(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ToasterContainer.Get"); scope.Start(); @@ -184,10 +183,10 @@ public override Response Get(string availabilitySetName, CancellationTo } } - /// + /// Gets details for this resource from the service. /// The name of the availability set. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ToasterContainer.Get"); scope.Start(); diff --git a/test/TestProjects/SubscriptionExtensions/SubscriptionExtensions.csproj b/test/TestProjects/SubscriptionExtensions/SubscriptionExtensions.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/SubscriptionExtensions/SubscriptionExtensions.csproj +++ b/test/TestProjects/SubscriptionExtensions/SubscriptionExtensions.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel1Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel1Container.cs index 1c292801718..412b96f29fe 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel1Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string cus } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string customModel1SName, CancellationToken cancellationToken = default) + public Response Get(string customModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string customModel1SName, Cancellatio } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string customModel1SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string customModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel2Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel2Container.cs index 8db4a655f03..4393c205bd9 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel2Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/CustomModel2Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string cus } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string customModel2SName, CancellationToken cancellationToken = default) + public Response Get(string customModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel2Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string customModel2SName, Cancellatio } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string customModel2SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string customModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CustomModel2Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel1Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel1Container.cs index c2fecd9f739..c74cd9d7fe3 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel1Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string r } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string resourceModel1SName, CancellationToken cancellationToken = default) + public Response Get(string resourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string resourceModel1SName, Cancell } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string resourceModel1SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel2Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel2Container.cs index a09bd48ba11..5bbc005094a 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel2Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/ResourceModel2Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string r } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string resourceModel2SName, CancellationToken cancellationToken = default) + public Response Get(string resourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceModel2Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string resourceModel2SName, Cancell } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string resourceModel2SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string resourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("ResourceModel2Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel1Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel1Container.cs index 4ddbaed1a22..94c376009e7 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel1Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(strin } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string subResourceModel1SName, CancellationToken cancellationToken = default) + public Response Get(string subResourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubResourceModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string subResourceModel1SName, C } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string subResourceModel1SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subResourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubResourceModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel2Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel2Container.cs index e5e44d1ec2d..fb15dd06c36 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel2Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/SubResourceModel2Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(strin } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string subResourceModel2SName, CancellationToken cancellationToken = default) + public Response Get(string subResourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubResourceModel2Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string subResourceModel2SName, C } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string subResourceModel2SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subResourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SubResourceModel2Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel1Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel1Container.cs index 9dc6fc7a092..be32cfc13d9 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel1Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(s } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string trackedResourceModel1SName, CancellationToken cancellationToken = default) + public Response Get(string trackedResourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("TrackedResourceModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string trackedResourceModel1 } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string trackedResourceModel1SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string trackedResourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("TrackedResourceModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel2Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel2Container.cs index e09e79fccb1..481c3c36829 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel2Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/TrackedResourceModel2Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(s } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string trackedResourceModel2SName, CancellationToken cancellationToken = default) + public Response Get(string trackedResourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("TrackedResourceModel2Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string trackedResourceModel2 } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string trackedResourceModel2SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string trackedResourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("TrackedResourceModel2Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel1Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel1Container.cs index f09af8085a4..bc7a15da145 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel1Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsy } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string writableSubResourceModel1SName, CancellationToken cancellationToken = default) + public Response Get(string writableSubResourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubResourceModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string writableSubResour } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string writableSubResourceModel1SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string writableSubResourceModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubResourceModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel2Container.cs b/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel2Container.cs index 2f72a8a2b03..3df44722056 100644 --- a/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel2Container.cs +++ b/test/TestProjects/SupersetFlattenInheritance/Generated/WritableSubResourceModel2Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetFlattenInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsy } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string writableSubResourceModel2SName, CancellationToken cancellationToken = default) + public Response Get(string writableSubResourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubResourceModel2Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string writableSubResour } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string writableSubResourceModel2SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string writableSubResourceModel2SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("WritableSubResourceModel2Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetFlattenInheritance/SupersetFlattenInheritance.csproj b/test/TestProjects/SupersetFlattenInheritance/SupersetFlattenInheritance.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/SupersetFlattenInheritance/SupersetFlattenInheritance.csproj +++ b/test/TestProjects/SupersetFlattenInheritance/SupersetFlattenInheritance.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/SupersetInheritance/Generated/SupersetModel1Container.cs b/test/TestProjects/SupersetInheritance/Generated/SupersetModel1Container.cs index c5a81e3b889..d6548547858 100644 --- a/test/TestProjects/SupersetInheritance/Generated/SupersetModel1Container.cs +++ b/test/TestProjects/SupersetInheritance/Generated/SupersetModel1Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string s } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string supersetModel1SName, CancellationToken cancellationToken = default) + public Response Get(string supersetModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SupersetModel1Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string supersetModel1SName, Cancell } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string supersetModel1SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string supersetModel1SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SupersetModel1Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetInheritance/Generated/SupersetModel4Container.cs b/test/TestProjects/SupersetInheritance/Generated/SupersetModel4Container.cs index f40152e0714..8fcece7f6c0 100644 --- a/test/TestProjects/SupersetInheritance/Generated/SupersetModel4Container.cs +++ b/test/TestProjects/SupersetInheritance/Generated/SupersetModel4Container.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace SupersetInheritance { @@ -159,10 +158,10 @@ public async Task StartCreateOrUpdateAsync(string s } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string supersetModel4SName, CancellationToken cancellationToken = default) + public Response Get(string supersetModel4SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SupersetModel4Container.Get"); scope.Start(); @@ -183,10 +182,10 @@ public override Response Get(string supersetModel4SName, Cancell } } - /// + /// Gets details for this resource from the service. /// The String to use. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string supersetModel4SName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string supersetModel4SName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("SupersetModel4Container.Get"); scope.Start(); diff --git a/test/TestProjects/SupersetInheritance/SupersetInheritance.csproj b/test/TestProjects/SupersetInheritance/SupersetInheritance.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/SupersetInheritance/SupersetInheritance.csproj +++ b/test/TestProjects/SupersetInheritance/SupersetInheritance.csproj @@ -11,7 +11,7 @@ - + diff --git a/test/TestProjects/TenantOnly/Generated/AgreementContainer.cs b/test/TestProjects/TenantOnly/Generated/AgreementContainer.cs index 7d798eebcb3..4f9fa879f0b 100644 --- a/test/TestProjects/TenantOnly/Generated/AgreementContainer.cs +++ b/test/TestProjects/TenantOnly/Generated/AgreementContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace TenantOnly { @@ -44,10 +43,11 @@ internal AgreementContainer(ResourceOperationsBase parent) : base(parent) // Container level operations. - /// + /// Gets details for this resource from the service. /// The ID that uniquely identifies an agreement. + /// May be used to expand the participants. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string agreementName, CancellationToken cancellationToken = default) + public Response Get(string agreementName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AgreementContainer.Get"); scope.Start(); @@ -58,7 +58,7 @@ public override Response Get(string agreementName, CancellationToken throw new ArgumentNullException(nameof(agreementName)); } - var response = _restClient.Get(Id.Name, agreementName, cancellationToken: cancellationToken); + var response = _restClient.Get(Id.Name, agreementName, expand, cancellationToken: cancellationToken); return Response.FromValue(new Agreement(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -68,10 +68,11 @@ public override Response Get(string agreementName, CancellationToken } } - /// + /// Gets details for this resource from the service. /// The ID that uniquely identifies an agreement. + /// May be used to expand the participants. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string agreementName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string agreementName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AgreementContainer.Get"); scope.Start(); @@ -82,7 +83,7 @@ public async override Task> GetAsync(string agreementName, C throw new ArgumentNullException(nameof(agreementName)); } - var response = await _restClient.GetAsync(Id.Name, agreementName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(Id.Name, agreementName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new Agreement(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/test/TestProjects/TenantOnly/Generated/BillingAccountContainer.cs b/test/TestProjects/TenantOnly/Generated/BillingAccountContainer.cs index a550fa09520..8c3ead00118 100644 --- a/test/TestProjects/TenantOnly/Generated/BillingAccountContainer.cs +++ b/test/TestProjects/TenantOnly/Generated/BillingAccountContainer.cs @@ -12,7 +12,6 @@ using Azure; using Azure.Core.Pipeline; using Azure.ResourceManager.Core; -using Azure.ResourceManager.Core.Resources; namespace TenantOnly { @@ -159,10 +158,11 @@ public async Task StartCreateOrUpdateAsync(strin } } - /// + /// Gets details for this resource from the service. /// The ID that uniquely identifies a billing account. + /// May be used to expand the soldTo, invoice sections and billing profiles. /// A token to allow the caller to cancel the call to the service. The default value is . - public override Response Get(string billingAccountName, CancellationToken cancellationToken = default) + public Response Get(string billingAccountName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("BillingAccountContainer.Get"); scope.Start(); @@ -173,7 +173,7 @@ public override Response Get(string billingAccountName, Cancella throw new ArgumentNullException(nameof(billingAccountName)); } - var response = _restClient.Get(billingAccountName, cancellationToken: cancellationToken); + var response = _restClient.Get(billingAccountName, expand, cancellationToken: cancellationToken); return Response.FromValue(new BillingAccount(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -183,10 +183,11 @@ public override Response Get(string billingAccountName, Cancella } } - /// + /// Gets details for this resource from the service. /// The ID that uniquely identifies a billing account. + /// May be used to expand the soldTo, invoice sections and billing profiles. /// A token to allow the caller to cancel the call to the service. The default value is . - public async override Task> GetAsync(string billingAccountName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string billingAccountName, string expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("BillingAccountContainer.Get"); scope.Start(); @@ -197,7 +198,7 @@ public async override Task> GetAsync(string billingAcco throw new ArgumentNullException(nameof(billingAccountName)); } - var response = await _restClient.GetAsync(billingAccountName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _restClient.GetAsync(billingAccountName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(new BillingAccount(Parent, response.Value), response.GetRawResponse()); } catch (Exception e) diff --git a/test/TestProjects/TenantOnly/TenantOnly.csproj b/test/TestProjects/TenantOnly/TenantOnly.csproj index 3afccf47c2f..41a97eca46d 100644 --- a/test/TestProjects/TenantOnly/TenantOnly.csproj +++ b/test/TestProjects/TenantOnly/TenantOnly.csproj @@ -11,7 +11,7 @@ - +