diff --git a/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs b/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs
index df7756174b7..5a11121365f 100644
--- a/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/BlobContainerContainer.cs
@@ -5,23 +5,357 @@
#nullable disable
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of BlobContainer and their operations over a StorageAccount.
- public partial class BlobContainerContainer
+ public partial class BlobContainerContainer : ResourceContainerBase
{
- /// Initializes a new instance of BlobContainerContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected BlobContainerContainer()
{
}
- internal BlobContainerContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of BlobContainerContainer class.
+ /// The resource representing the parent resource.
+ internal BlobContainerContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private BlobContainersRestOperations _restClient => new BlobContainersRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a BlobContainer. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the blob container to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string containerName, BlobContainerData blobContainer, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (containerName == null)
+ {
+ throw new ArgumentNullException(nameof(containerName));
+ }
+ if (blobContainer == null)
+ {
+ throw new ArgumentNullException(nameof(blobContainer));
+ }
+
+ return StartCreateOrUpdate(containerName, blobContainer, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a BlobContainer. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the blob container to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string containerName, BlobContainerData blobContainer, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (containerName == null)
+ {
+ throw new ArgumentNullException(nameof(containerName));
+ }
+ if (blobContainer == null)
+ {
+ throw new ArgumentNullException(nameof(blobContainer));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(containerName, blobContainer, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a BlobContainer. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the blob container to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string containerName, BlobContainerData blobContainer, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (containerName == null)
+ {
+ throw new ArgumentNullException(nameof(containerName));
+ }
+ if (blobContainer == null)
+ {
+ throw new ArgumentNullException(nameof(blobContainer));
+ }
+
+ var originalResponse = _restClient.Create(Id.ResourceGroupName, Id.Parent.Name, containerName, blobContainer, cancellationToken: cancellationToken);
+ return new BlobContainersCreateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a BlobContainer. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the blob container to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string containerName, BlobContainerData blobContainer, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (containerName == null)
+ {
+ throw new ArgumentNullException(nameof(containerName));
+ }
+ if (blobContainer == null)
+ {
+ throw new ArgumentNullException(nameof(blobContainer));
+ }
+
+ var originalResponse = await _restClient.CreateAsync(Id.ResourceGroupName, Id.Parent.Name, containerName, blobContainer, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new BlobContainersCreateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.Get");
+ scope.Start();
+ try
+ {
+ if (containerName == null)
+ {
+ throw new ArgumentNullException(nameof(containerName));
+ }
+
+ var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, containerName, cancellationToken: cancellationToken);
+ return Response.FromValue(new BlobContainer(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.Get");
+ scope.Start();
+ try
+ {
+ if (containerName == null)
+ {
+ throw new ArgumentNullException(nameof(containerName));
+ }
+
+ var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Name, containerName, cancellationToken: cancellationToken);
+ return Response.FromValue(new BlobContainer(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.List(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new BlobContainer(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.ListNextPage(nextLink, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new BlobContainer(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new BlobContainerOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListAsync(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new BlobContainer(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListNextPageAsync(nextLink, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new BlobContainer(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new BlobContainerOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of BlobContainer for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(BlobContainerOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of BlobContainer for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobContainerContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(BlobContainerOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/BlobContainerOperations.cs b/samples/Azure.Management.Storage/Generated/BlobContainerOperations.cs
index 1efdb019288..40c7cb6a5d7 100644
--- a/samples/Azure.Management.Storage/Generated/BlobContainerOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/BlobContainerOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific BlobContainer.
public partial class BlobContainerOperations : ResourceOperationsBase
{
- /// Initializes a new instance of BlobContainerOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected BlobContainerOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a BlobContainer.
+ internal BlobContainerOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected BlobContainerOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs b/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs
index 37b6ef4ebab..83548d1bb9c 100644
--- a/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/BlobServiceContainer.cs
@@ -5,23 +5,327 @@
#nullable disable
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of BlobService and their operations over a StorageAccount.
- public partial class BlobServiceContainer
+ public partial class BlobServiceContainer : ResourceContainerBase
{
- /// Initializes a new instance of BlobServiceContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected BlobServiceContainer()
{
}
- internal BlobServiceContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of BlobServiceContainer class.
+ /// The resource representing the parent resource.
+ internal BlobServiceContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private BlobServicesRestOperations _restClient => new BlobServicesRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a BlobService. Please note some properties can be set only during creation.
+ /// 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.
+ /// The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string accountName, BlobServiceData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ return StartCreateOrUpdate(accountName, parameters, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a BlobService. Please note some properties can be set only during creation.
+ /// 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.
+ /// The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string accountName, BlobServiceData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(accountName, parameters, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a BlobService. Please note some properties can be set only during creation.
+ /// 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.
+ /// The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string accountName, BlobServiceData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var originalResponse = _restClient.SetServiceProperties(Id.ResourceGroupName, accountName, parameters, cancellationToken: cancellationToken);
+ return new BlobServicesSetServicePropertiesOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a BlobService. Please note some properties can be set only during creation.
+ /// 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.
+ /// The properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string accountName, BlobServiceData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var originalResponse = await _restClient.SetServicePropertiesAsync(Id.ResourceGroupName, accountName, parameters, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new BlobServicesSetServicePropertiesOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.Get");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var response = _restClient.GetServiceProperties(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken);
+ return Response.FromValue(new BlobService(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.Get");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var response = await _restClient.GetServicePropertiesAsync(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken);
+ return Response.FromValue(new BlobService(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.List(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new BlobService(Parent, value)), null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new BlobServiceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListAsync(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new BlobService(Parent, value)), null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new BlobServiceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of BlobService for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(BlobServiceOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of BlobService for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("BlobServiceContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(BlobServiceOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/BlobServiceOperations.cs b/samples/Azure.Management.Storage/Generated/BlobServiceOperations.cs
index 12b4a371474..ab8749c8229 100644
--- a/samples/Azure.Management.Storage/Generated/BlobServiceOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/BlobServiceOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific BlobService.
public partial class BlobServiceOperations : ResourceOperationsBase
{
- /// Initializes a new instance of BlobServiceOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected BlobServiceOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a BlobService.
+ internal BlobServiceOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected BlobServiceOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/CodeModel.yaml b/samples/Azure.Management.Storage/Generated/CodeModel.yaml
index be88b3c4171..3ee9faf20c2 100644
--- a/samples/Azure.Management.Storage/Generated/CodeModel.yaml
+++ b/samples/Azure.Management.Storage/Generated/CodeModel.yaml
@@ -73,7 +73,7 @@ schemas: !Schemas
The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been
created for this container.
protocol: !Protocols {}
- - !BooleanSchema &ref_40
+ - !BooleanSchema &ref_38
type: boolean
language: !Languages
default:
@@ -246,7 +246,7 @@ schemas: !Schemas
name: LeaseContainerRequestLeaseDuration
description: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
protocol: !Protocols {}
- - !NumberSchema &ref_36
+ - !NumberSchema &ref_34
type: integer
apiVersions:
- !ApiVersion
@@ -259,7 +259,7 @@ schemas: !Schemas
name: FileSharePropertiesShareQuota
description: The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
protocol: !Protocols {}
- - !NumberSchema &ref_42
+ - !NumberSchema &ref_40
type: integer
apiVersions:
- !ApiVersion
@@ -270,7 +270,7 @@ schemas: !Schemas
name: FileSharePropertiesRemainingRetentionDays
description: Remaining retention days for share that was soft deleted.
protocol: !Protocols {}
- - !NumberSchema &ref_46
+ - !NumberSchema &ref_44
type: integer
apiVersions:
- !ApiVersion
@@ -712,7 +712,7 @@ schemas: !Schemas
name: String
description: ''
protocol: !Protocols {}
- - !StringSchema &ref_39
+ - !StringSchema &ref_37
type: string
apiVersions:
- !ApiVersion
@@ -722,7 +722,7 @@ schemas: !Schemas
name: FileSharePropertiesVersion
description: The version of the share.
protocol: !Protocols {}
- - !StringSchema &ref_45
+ - !StringSchema &ref_43
type: string
apiVersions:
- !ApiVersion
@@ -2184,7 +2184,7 @@ schemas: !Schemas
name: LeaseContainerRequestAction
description: Specifies the lease action. Can be one of the available actions.
protocol: !Protocols {}
- - !ChoiceSchema &ref_37
+ - !ChoiceSchema &ref_35
choices:
- !ChoiceValue
value: SMB
@@ -2212,7 +2212,7 @@ schemas: !Schemas
name: EnabledProtocols
description: The authentication protocol that is used for the file share. Can only be specified when creating a share.
protocol: !Protocols {}
- - !ChoiceSchema &ref_38
+ - !ChoiceSchema &ref_36
choices:
- !ChoiceValue
value: NoRootSquash
@@ -2242,7 +2242,7 @@ schemas: !Schemas
name: RootSquashType
description: The property is for NFS share only. The default is NoRootSquash.
protocol: !Protocols {}
- - !ChoiceSchema &ref_43
+ - !ChoiceSchema &ref_41
choices:
- !ChoiceValue
value: TransactionOptimized
@@ -3361,7 +3361,7 @@ schemas: !Schemas
name: ContainerPropertiesMetadata
description: A name-value pair to associate with the container as metadata.
protocol: !Protocols {}
- - !DictionarySchema &ref_35
+ - !DictionarySchema &ref_33
type: dictionary
elementType: *ref_2
language: !Languages
@@ -3442,7 +3442,7 @@ schemas: !Schemas
name: TagPropertyTimestamp
description: Returns the date and time the tag was added.
protocol: !Protocols {}
- - !DateTimeSchema &ref_34
+ - !DateTimeSchema &ref_32
type: date-time
format: date-time
apiVersions:
@@ -3453,7 +3453,7 @@ schemas: !Schemas
name: FileSharePropertiesLastModifiedTime
description: Returns the date and time the share was last modified.
protocol: !Protocols {}
- - !DateTimeSchema &ref_41
+ - !DateTimeSchema &ref_39
type: date-time
format: date-time
apiVersions:
@@ -3464,7 +3464,7 @@ schemas: !Schemas
name: FileSharePropertiesDeletedTime
description: The deleted time if the share was deleted.
protocol: !Protocols {}
- - !DateTimeSchema &ref_44
+ - !DateTimeSchema &ref_42
type: date-time
format: date-time
apiVersions:
@@ -3775,7 +3775,7 @@ schemas: !Schemas
description: A name-value pair to associate with the container as metadata.
protocol: !Protocols {}
- !Property
- schema: !ObjectSchema &ref_32
+ schema: !ObjectSchema &ref_45
type: object
apiVersions:
- !ApiVersion
@@ -3937,7 +3937,7 @@ schemas: !Schemas
description: The ImmutabilityPolicy property of the container.
protocol: !Protocols {}
- !Property
- schema: !ObjectSchema &ref_33
+ schema: !ObjectSchema &ref_46
type: object
apiVersions:
- !ApiVersion
@@ -4084,173 +4084,6 @@ schemas: !Schemas
protocol: !Protocols {}
serializationFormats:
- json
- usage:
- - output
- - input
- language: !Languages
- default:
- name: ListContainerItem
- description: The blob container properties be listed out.
- namespace: ''
- protocol: !Protocols {}
- - !ObjectSchema &ref_48
- type: object
- apiVersions:
- - !ApiVersion
- version: '2019-06-01'
- parents: !Relations
- all:
- - *ref_5
- - *ref_6
- immediate:
- - *ref_5
- properties:
- - !Property
- schema: *ref_7
- flattenedNames:
- - properties
- - defaultEncryptionScope
- serializedName: defaultEncryptionScope
- language: !Languages
- default:
- name: defaultEncryptionScope
- description: Default the container to use specified encryption scope for all writes.
- protocol: !Protocols {}
- - !Property
- schema: *ref_8
- flattenedNames:
- - properties
- - denyEncryptionScopeOverride
- serializedName: denyEncryptionScopeOverride
- language: !Languages
- default:
- name: denyEncryptionScopeOverride
- description: Block override of encryption scope from the container default.
- protocol: !Protocols {}
- - !Property
- schema: *ref_9
- flattenedNames:
- - properties
- - publicAccess
- serializedName: publicAccess
- language: !Languages
- default:
- name: publicAccess
- description: Specifies whether data in the container may be accessed publicly and the level of access.
- protocol: !Protocols {}
- - !Property
- schema: *ref_10
- flattenedNames:
- - properties
- - lastModifiedTime
- readOnly: true
- serializedName: lastModifiedTime
- language: !Languages
- default:
- name: lastModifiedTime
- description: Returns the date and time the container was last modified.
- protocol: !Protocols {}
- - !Property
- schema: *ref_11
- flattenedNames:
- - properties
- - leaseStatus
- readOnly: true
- serializedName: leaseStatus
- language: !Languages
- default:
- name: leaseStatus
- description: The lease status of the container.
- protocol: !Protocols {}
- - !Property
- schema: *ref_12
- flattenedNames:
- - properties
- - leaseState
- readOnly: true
- serializedName: leaseState
- language: !Languages
- default:
- name: leaseState
- description: Lease state of the container.
- protocol: !Protocols {}
- - !Property
- schema: *ref_13
- flattenedNames:
- - properties
- - leaseDuration
- readOnly: true
- serializedName: leaseDuration
- language: !Languages
- default:
- name: leaseDuration
- description: Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.
- protocol: !Protocols {}
- - !Property
- schema: *ref_14
- flattenedNames:
- - properties
- - metadata
- serializedName: metadata
- language: !Languages
- default:
- name: metadata
- description: A name-value pair to associate with the container as metadata.
- protocol: !Protocols {}
- - !Property
- schema: *ref_32
- flattenedNames:
- - properties
- - immutabilityPolicy
- readOnly: true
- serializedName: immutabilityPolicy
- language: !Languages
- default:
- name: immutabilityPolicy
- description: The ImmutabilityPolicy property of the container.
- protocol: !Protocols {}
- - !Property
- schema: *ref_33
- flattenedNames:
- - properties
- - legalHold
- readOnly: true
- serializedName: legalHold
- language: !Languages
- default:
- name: legalHold
- description: The LegalHold property of the container.
- protocol: !Protocols {}
- - !Property
- schema: *ref_25
- flattenedNames:
- - properties
- - hasLegalHold
- readOnly: true
- serializedName: hasLegalHold
- language: !Languages
- default:
- name: hasLegalHold
- description: >-
- The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared
- out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
- protocol: !Protocols {}
- - !Property
- schema: *ref_31
- flattenedNames:
- - properties
- - hasImmutabilityPolicy
- readOnly: true
- serializedName: hasImmutabilityPolicy
- language: !Languages
- default:
- name: hasImmutabilityPolicy
- description: >-
- The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if
- ImmutabilityPolicy has not been created for this container.
- protocol: !Protocols {}
- serializationFormats:
- - json
usage:
- input
- output
@@ -4260,7 +4093,7 @@ schemas: !Schemas
description: Properties of the blob container, including Id, resource name, resource type, Etag.
namespace: ''
protocol: !Protocols {}
- - !ObjectSchema &ref_49
+ - !ObjectSchema &ref_48
type: object
apiVersions:
- !ApiVersion
@@ -4319,7 +4152,7 @@ schemas: !Schemas
description: The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.
namespace: ''
protocol: !Protocols {}
- - !ObjectSchema &ref_50
+ - !ObjectSchema &ref_49
type: object
apiVersions:
- !ApiVersion
@@ -4332,7 +4165,7 @@ schemas: !Schemas
- *ref_5
properties:
- !Property
- schema: *ref_34
+ schema: *ref_32
flattenedNames:
- properties
- lastModifiedTime
@@ -4344,7 +4177,7 @@ schemas: !Schemas
description: Returns the date and time the share was last modified.
protocol: !Protocols {}
- !Property
- schema: *ref_35
+ schema: *ref_33
flattenedNames:
- properties
- metadata
@@ -4355,7 +4188,7 @@ schemas: !Schemas
description: A name-value pair to associate with the share as metadata.
protocol: !Protocols {}
- !Property
- schema: *ref_36
+ schema: *ref_34
flattenedNames:
- properties
- shareQuota
@@ -4366,7 +4199,7 @@ schemas: !Schemas
description: The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
protocol: !Protocols {}
- !Property
- schema: *ref_37
+ schema: *ref_35
flattenedNames:
- properties
- enabledProtocols
@@ -4377,7 +4210,7 @@ schemas: !Schemas
description: The authentication protocol that is used for the file share. Can only be specified when creating a share.
protocol: !Protocols {}
- !Property
- schema: *ref_38
+ schema: *ref_36
flattenedNames:
- properties
- rootSquash
@@ -4388,7 +4221,7 @@ schemas: !Schemas
description: The property is for NFS share only. The default is NoRootSquash.
protocol: !Protocols {}
- !Property
- schema: *ref_39
+ schema: *ref_37
flattenedNames:
- properties
- version
@@ -4400,7 +4233,7 @@ schemas: !Schemas
description: The version of the share.
protocol: !Protocols {}
- !Property
- schema: *ref_40
+ schema: *ref_38
flattenedNames:
- properties
- deleted
@@ -4412,7 +4245,7 @@ schemas: !Schemas
description: Indicates whether the share was deleted.
protocol: !Protocols {}
- !Property
- schema: *ref_41
+ schema: *ref_39
flattenedNames:
- properties
- deletedTime
@@ -4424,7 +4257,7 @@ schemas: !Schemas
description: The deleted time if the share was deleted.
protocol: !Protocols {}
- !Property
- schema: *ref_42
+ schema: *ref_40
flattenedNames:
- properties
- remainingRetentionDays
@@ -4436,7 +4269,7 @@ schemas: !Schemas
description: Remaining retention days for share that was soft deleted.
protocol: !Protocols {}
- !Property
- schema: *ref_43
+ schema: *ref_41
flattenedNames:
- properties
- accessTier
@@ -4447,7 +4280,7 @@ schemas: !Schemas
description: Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
protocol: !Protocols {}
- !Property
- schema: *ref_44
+ schema: *ref_42
flattenedNames:
- properties
- accessTierChangeTime
@@ -4459,7 +4292,7 @@ schemas: !Schemas
description: Indicates the last modification time for share access tier.
protocol: !Protocols {}
- !Property
- schema: *ref_45
+ schema: *ref_43
flattenedNames:
- properties
- accessTierStatus
@@ -4471,7 +4304,7 @@ schemas: !Schemas
description: Indicates if there is a pending transition for access tier.
protocol: !Protocols {}
- !Property
- schema: *ref_46
+ schema: *ref_44
flattenedNames:
- properties
- shareUsageBytes
@@ -4484,13 +4317,180 @@ schemas: !Schemas
protocol: !Protocols {}
serializationFormats:
- json
+ usage:
+ - input
+ - output
+ language: !Languages
+ default:
+ name: FileShare
+ description: Properties of the file share, including Id, resource name, resource type, Etag.
+ namespace: ''
+ protocol: !Protocols {}
+ - !ObjectSchema &ref_50
+ type: object
+ apiVersions:
+ - !ApiVersion
+ version: '2019-06-01'
+ parents: !Relations
+ all:
+ - *ref_5
+ - *ref_6
+ immediate:
+ - *ref_5
+ properties:
+ - !Property
+ schema: *ref_7
+ flattenedNames:
+ - properties
+ - defaultEncryptionScope
+ serializedName: defaultEncryptionScope
+ language: !Languages
+ default:
+ name: defaultEncryptionScope
+ description: Default the container to use specified encryption scope for all writes.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_8
+ flattenedNames:
+ - properties
+ - denyEncryptionScopeOverride
+ serializedName: denyEncryptionScopeOverride
+ language: !Languages
+ default:
+ name: denyEncryptionScopeOverride
+ description: Block override of encryption scope from the container default.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_9
+ flattenedNames:
+ - properties
+ - publicAccess
+ serializedName: publicAccess
+ language: !Languages
+ default:
+ name: publicAccess
+ description: Specifies whether data in the container may be accessed publicly and the level of access.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_10
+ flattenedNames:
+ - properties
+ - lastModifiedTime
+ readOnly: true
+ serializedName: lastModifiedTime
+ language: !Languages
+ default:
+ name: lastModifiedTime
+ description: Returns the date and time the container was last modified.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_11
+ flattenedNames:
+ - properties
+ - leaseStatus
+ readOnly: true
+ serializedName: leaseStatus
+ language: !Languages
+ default:
+ name: leaseStatus
+ description: The lease status of the container.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_12
+ flattenedNames:
+ - properties
+ - leaseState
+ readOnly: true
+ serializedName: leaseState
+ language: !Languages
+ default:
+ name: leaseState
+ description: Lease state of the container.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_13
+ flattenedNames:
+ - properties
+ - leaseDuration
+ readOnly: true
+ serializedName: leaseDuration
+ language: !Languages
+ default:
+ name: leaseDuration
+ description: Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_14
+ flattenedNames:
+ - properties
+ - metadata
+ serializedName: metadata
+ language: !Languages
+ default:
+ name: metadata
+ description: A name-value pair to associate with the container as metadata.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_45
+ flattenedNames:
+ - properties
+ - immutabilityPolicy
+ readOnly: true
+ serializedName: immutabilityPolicy
+ language: !Languages
+ default:
+ name: immutabilityPolicy
+ description: The ImmutabilityPolicy property of the container.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_46
+ flattenedNames:
+ - properties
+ - legalHold
+ readOnly: true
+ serializedName: legalHold
+ language: !Languages
+ default:
+ name: legalHold
+ description: The LegalHold property of the container.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_25
+ flattenedNames:
+ - properties
+ - hasLegalHold
+ readOnly: true
+ serializedName: hasLegalHold
+ language: !Languages
+ default:
+ name: hasLegalHold
+ description: >-
+ The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared
+ out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.
+ protocol: !Protocols {}
+ - !Property
+ schema: *ref_31
+ flattenedNames:
+ - properties
+ - hasImmutabilityPolicy
+ readOnly: true
+ serializedName: hasImmutabilityPolicy
+ language: !Languages
+ default:
+ name: hasImmutabilityPolicy
+ description: >-
+ The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if
+ ImmutabilityPolicy has not been created for this container.
+ protocol: !Protocols {}
+ serializationFormats:
+ - json
usage:
- output
- input
language: !Languages
default:
- name: FileShareItem
- description: The file share properties be listed out.
+ name: ListContainerItem
+ description: The blob container properties be listed out.
namespace: ''
protocol: !Protocols {}
- !ObjectSchema &ref_51
@@ -4506,7 +4506,7 @@ schemas: !Schemas
- *ref_5
properties:
- !Property
- schema: *ref_34
+ schema: *ref_32
flattenedNames:
- properties
- lastModifiedTime
@@ -4518,7 +4518,7 @@ schemas: !Schemas
description: Returns the date and time the share was last modified.
protocol: !Protocols {}
- !Property
- schema: *ref_35
+ schema: *ref_33
flattenedNames:
- properties
- metadata
@@ -4529,7 +4529,7 @@ schemas: !Schemas
description: A name-value pair to associate with the share as metadata.
protocol: !Protocols {}
- !Property
- schema: *ref_36
+ schema: *ref_34
flattenedNames:
- properties
- shareQuota
@@ -4540,7 +4540,7 @@ schemas: !Schemas
description: The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
protocol: !Protocols {}
- !Property
- schema: *ref_37
+ schema: *ref_35
flattenedNames:
- properties
- enabledProtocols
@@ -4551,7 +4551,7 @@ schemas: !Schemas
description: The authentication protocol that is used for the file share. Can only be specified when creating a share.
protocol: !Protocols {}
- !Property
- schema: *ref_38
+ schema: *ref_36
flattenedNames:
- properties
- rootSquash
@@ -4562,7 +4562,7 @@ schemas: !Schemas
description: The property is for NFS share only. The default is NoRootSquash.
protocol: !Protocols {}
- !Property
- schema: *ref_39
+ schema: *ref_37
flattenedNames:
- properties
- version
@@ -4574,7 +4574,7 @@ schemas: !Schemas
description: The version of the share.
protocol: !Protocols {}
- !Property
- schema: *ref_40
+ schema: *ref_38
flattenedNames:
- properties
- deleted
@@ -4586,7 +4586,7 @@ schemas: !Schemas
description: Indicates whether the share was deleted.
protocol: !Protocols {}
- !Property
- schema: *ref_41
+ schema: *ref_39
flattenedNames:
- properties
- deletedTime
@@ -4598,7 +4598,7 @@ schemas: !Schemas
description: The deleted time if the share was deleted.
protocol: !Protocols {}
- !Property
- schema: *ref_42
+ schema: *ref_40
flattenedNames:
- properties
- remainingRetentionDays
@@ -4610,7 +4610,7 @@ schemas: !Schemas
description: Remaining retention days for share that was soft deleted.
protocol: !Protocols {}
- !Property
- schema: *ref_43
+ schema: *ref_41
flattenedNames:
- properties
- accessTier
@@ -4621,7 +4621,7 @@ schemas: !Schemas
description: Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.
protocol: !Protocols {}
- !Property
- schema: *ref_44
+ schema: *ref_42
flattenedNames:
- properties
- accessTierChangeTime
@@ -4633,7 +4633,7 @@ schemas: !Schemas
description: Indicates the last modification time for share access tier.
protocol: !Protocols {}
- !Property
- schema: *ref_45
+ schema: *ref_43
flattenedNames:
- properties
- accessTierStatus
@@ -4645,7 +4645,7 @@ schemas: !Schemas
description: Indicates if there is a pending transition for access tier.
protocol: !Protocols {}
- !Property
- schema: *ref_46
+ schema: *ref_44
flattenedNames:
- properties
- shareUsageBytes
@@ -4659,12 +4659,12 @@ schemas: !Schemas
serializationFormats:
- json
usage:
- - input
- output
+ - input
language: !Languages
default:
- name: FileShare
- description: Properties of the file share, including Id, resource name, resource type, Etag.
+ name: FileShareItem
+ description: The file share properties be listed out.
namespace: ''
protocol: !Protocols {}
immediate:
@@ -4701,7 +4701,6 @@ schemas: !Schemas
protocol: !Protocols {}
- *ref_47
- *ref_48
- - *ref_49
- !ObjectSchema &ref_171
type: object
apiVersions:
@@ -4959,8 +4958,7 @@ schemas: !Schemas
description: The properties of File services in storage account.
namespace: ''
protocol: !Protocols {}
- - *ref_50
- - *ref_51
+ - *ref_49
- !ObjectSchema &ref_62
type: object
apiVersions:
@@ -7200,6 +7198,8 @@ schemas: !Schemas
description: The Encryption Scope resource.
namespace: ''
protocol: !Protocols {}
+ - *ref_50
+ - *ref_51
immediate:
- *ref_4
- *ref_5
@@ -7508,11 +7508,10 @@ schemas: !Schemas
protocol: !Protocols {}
- *ref_5
- *ref_47
- - *ref_32
+ - *ref_45
- *ref_192
- - *ref_33
+ - *ref_46
- *ref_193
- - *ref_48
- !ObjectSchema &ref_399
type: object
apiVersions:
@@ -7561,7 +7560,7 @@ schemas: !Schemas
description: The LegalHold property of a blob container.
namespace: ''
protocol: !Protocols {}
- - *ref_49
+ - *ref_48
- !ObjectSchema &ref_443
type: object
apiVersions:
@@ -7789,7 +7788,7 @@ schemas: !Schemas
apiVersions:
- !ApiVersion
version: '2019-06-01'
- elementType: *ref_50
+ elementType: *ref_49
language: !Languages
default:
name: FileShareItemsValue
@@ -7821,8 +7820,7 @@ schemas: !Schemas
description: Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares.
namespace: ''
protocol: !Protocols {}
- - *ref_50
- - *ref_51
+ - *ref_49
- !ObjectSchema &ref_483
type: object
apiVersions:
@@ -9556,6 +9554,8 @@ schemas: !Schemas
description: List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes.
namespace: ''
protocol: !Protocols {}
+ - *ref_50
+ - *ref_51
arrays:
- *ref_322
- *ref_323
@@ -10411,7 +10411,7 @@ operationGroups:
http: !HttpParameter
in: header
- !Parameter &ref_385
- schema: *ref_48
+ schema: *ref_47
implementation: Method
required: true
language: !Languages
@@ -10455,7 +10455,7 @@ operationGroups:
- *ref_388
responses:
- !SchemaResponse
- schema: *ref_48
+ schema: *ref_47
language: !Languages
default:
name: ''
@@ -10468,7 +10468,7 @@ operationGroups:
statusCodes:
- '200'
- !SchemaResponse
- schema: *ref_48
+ schema: *ref_47
language: !Languages
default:
name: ''
@@ -10599,7 +10599,7 @@ operationGroups:
http: !HttpParameter
in: header
- !Parameter &ref_389
- schema: *ref_48
+ schema: *ref_47
implementation: Method
required: true
language: !Languages
@@ -10643,7 +10643,7 @@ operationGroups:
- *ref_392
responses:
- !SchemaResponse
- schema: *ref_48
+ schema: *ref_47
language: !Languages
default:
name: ''
@@ -10765,7 +10765,7 @@ operationGroups:
- *ref_395
responses:
- !SchemaResponse
- schema: *ref_48
+ schema: *ref_47
language: !Languages
default:
name: ''
@@ -11343,7 +11343,7 @@ operationGroups:
http: !HttpParameter
in: header
- !Parameter &ref_411
- schema: *ref_49
+ schema: *ref_48
flattened: true
implementation: Method
required: false
@@ -11414,7 +11414,7 @@ operationGroups:
- *ref_419
responses:
- !SchemaResponse
- schema: *ref_49
+ schema: *ref_48
language: !Languages
default:
name: ''
@@ -11569,7 +11569,7 @@ operationGroups:
- *ref_424
responses:
- !SchemaResponse
- schema: *ref_49
+ schema: *ref_48
language: !Languages
default:
name: ''
@@ -11721,7 +11721,7 @@ operationGroups:
- *ref_429
responses:
- !SchemaResponse
- schema: *ref_49
+ schema: *ref_48
language: !Languages
default:
name: ''
@@ -11863,7 +11863,7 @@ operationGroups:
- *ref_434
responses:
- !SchemaResponse
- schema: *ref_49
+ schema: *ref_48
language: !Languages
default:
name: ''
@@ -11986,7 +11986,7 @@ operationGroups:
http: !HttpParameter
in: header
- !Parameter &ref_436
- schema: *ref_49
+ schema: *ref_48
flattened: true
implementation: Method
required: false
@@ -12057,7 +12057,7 @@ operationGroups:
- *ref_442
responses:
- !SchemaResponse
- schema: *ref_49
+ schema: *ref_48
language: !Languages
default:
name: ''
@@ -13128,7 +13128,7 @@ operationGroups:
http: !HttpParameter
in: header
- !Parameter &ref_468
- schema: *ref_51
+ schema: *ref_49
implementation: Method
required: true
language: !Languages
@@ -13172,7 +13172,7 @@ operationGroups:
- *ref_471
responses:
- !SchemaResponse
- schema: *ref_51
+ schema: *ref_49
language: !Languages
default:
name: ''
@@ -13185,7 +13185,7 @@ operationGroups:
statusCodes:
- '200'
- !SchemaResponse
- schema: *ref_51
+ schema: *ref_49
language: !Languages
default:
name: ''
@@ -13353,7 +13353,7 @@ operationGroups:
http: !HttpParameter
in: header
- !Parameter &ref_472
- schema: *ref_51
+ schema: *ref_49
implementation: Method
required: true
language: !Languages
@@ -13397,7 +13397,7 @@ operationGroups:
- *ref_475
responses:
- !SchemaResponse
- schema: *ref_51
+ schema: *ref_49
language: !Languages
default:
name: ''
@@ -13540,7 +13540,7 @@ operationGroups:
- *ref_479
responses:
- !SchemaResponse
- schema: *ref_51
+ schema: *ref_49
language: !Languages
default:
name: ''
diff --git a/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs b/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs
index 05c3f812f04..7f9beb14227 100644
--- a/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/EncryptionScopeContainer.cs
@@ -5,23 +5,357 @@
#nullable disable
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of EncryptionScope and their operations over a StorageAccount.
- public partial class EncryptionScopeContainer
+ public partial class EncryptionScopeContainer : ResourceContainerBase
{
- /// Initializes a new instance of EncryptionScopeContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected EncryptionScopeContainer()
{
}
- internal EncryptionScopeContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of EncryptionScopeContainer class.
+ /// The resource representing the parent resource.
+ internal EncryptionScopeContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private EncryptionScopesRestOperations _restClient => new EncryptionScopesRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a EncryptionScope. Please note some properties can be set only during creation.
+ /// 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.
+ /// Encryption scope properties to be used for the create or update.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string encryptionScopeName, EncryptionScopeData encryptionScope, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (encryptionScopeName == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScopeName));
+ }
+ if (encryptionScope == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScope));
+ }
+
+ return StartCreateOrUpdate(encryptionScopeName, encryptionScope, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a EncryptionScope. Please note some properties can be set only during creation.
+ /// 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.
+ /// Encryption scope properties to be used for the create or update.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string encryptionScopeName, EncryptionScopeData encryptionScope, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (encryptionScopeName == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScopeName));
+ }
+ if (encryptionScope == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScope));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(encryptionScopeName, encryptionScope, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a EncryptionScope. Please note some properties can be set only during creation.
+ /// 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.
+ /// Encryption scope properties to be used for the create or update.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string encryptionScopeName, EncryptionScopeData encryptionScope, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (encryptionScopeName == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScopeName));
+ }
+ if (encryptionScope == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScope));
+ }
+
+ var originalResponse = _restClient.Put(Id.ResourceGroupName, Id.Parent.Name, encryptionScopeName, encryptionScope, cancellationToken: cancellationToken);
+ return new EncryptionScopesPutOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a EncryptionScope. Please note some properties can be set only during creation.
+ /// 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.
+ /// Encryption scope properties to be used for the create or update.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string encryptionScopeName, EncryptionScopeData encryptionScope, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (encryptionScopeName == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScopeName));
+ }
+ if (encryptionScope == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScope));
+ }
+
+ var originalResponse = await _restClient.PutAsync(Id.ResourceGroupName, Id.Parent.Name, encryptionScopeName, encryptionScope, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new EncryptionScopesPutOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.Get");
+ scope.Start();
+ try
+ {
+ if (encryptionScopeName == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScopeName));
+ }
+
+ var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, encryptionScopeName, cancellationToken: cancellationToken);
+ return Response.FromValue(new EncryptionScope(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.Get");
+ scope.Start();
+ try
+ {
+ if (encryptionScopeName == null)
+ {
+ throw new ArgumentNullException(nameof(encryptionScopeName));
+ }
+
+ var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Name, encryptionScopeName, cancellationToken: cancellationToken);
+ return Response.FromValue(new EncryptionScope(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.List(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new EncryptionScope(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.ListNextPage(nextLink, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new EncryptionScope(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new EncryptionScopeOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListAsync(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new EncryptionScope(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListNextPageAsync(nextLink, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new EncryptionScope(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new EncryptionScopeOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of EncryptionScope for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(EncryptionScopeOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of EncryptionScope for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("EncryptionScopeContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(EncryptionScopeOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/EncryptionScopeOperations.cs b/samples/Azure.Management.Storage/Generated/EncryptionScopeOperations.cs
index 7702f371cd2..1dd92fe9bde 100644
--- a/samples/Azure.Management.Storage/Generated/EncryptionScopeOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/EncryptionScopeOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific EncryptionScope.
public partial class EncryptionScopeOperations : ResourceOperationsBase
{
- /// Initializes a new instance of EncryptionScopeOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected EncryptionScopeOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a EncryptionScope.
+ internal EncryptionScopeOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected EncryptionScopeOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs b/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs
index ffca0434df4..4fb3c871343 100644
--- a/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/FileServiceContainer.cs
@@ -5,23 +5,286 @@
#nullable disable
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of FileService and their operations over a StorageAccount.
- public partial class FileServiceContainer
+ public partial class FileServiceContainer : ResourceContainerBase
{
- /// Initializes a new instance of FileServiceContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected FileServiceContainer()
{
}
- internal FileServiceContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of FileServiceContainer class.
+ /// The resource representing the parent resource.
+ internal FileServiceContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private FileServicesRestOperations _restClient => new FileServicesRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a FileService. Please note some properties can be set only during creation.
+ /// 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.
+ /// Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service.
+ /// The file service properties for share soft delete.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string accountName, CorsRules cors = null, DeleteRetentionPolicy shareDeleteRetentionPolicy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ return StartCreateOrUpdate(accountName, cors, shareDeleteRetentionPolicy, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a FileService. Please note some properties can be set only during creation.
+ /// 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.
+ /// Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service.
+ /// The file service properties for share soft delete.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string accountName, CorsRules cors = null, DeleteRetentionPolicy shareDeleteRetentionPolicy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(accountName, cors, shareDeleteRetentionPolicy, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a FileService. Please note some properties can be set only during creation.
+ /// 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.
+ /// Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service.
+ /// The file service properties for share soft delete.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string accountName, CorsRules cors = null, DeleteRetentionPolicy shareDeleteRetentionPolicy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var originalResponse = _restClient.SetServiceProperties(Id.ResourceGroupName, accountName, cors, shareDeleteRetentionPolicy, cancellationToken: cancellationToken);
+ return new FileServicesSetServicePropertiesOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a FileService. Please note some properties can be set only during creation.
+ /// 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.
+ /// Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service.
+ /// The file service properties for share soft delete.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string accountName, CorsRules cors = null, DeleteRetentionPolicy shareDeleteRetentionPolicy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var originalResponse = await _restClient.SetServicePropertiesAsync(Id.ResourceGroupName, accountName, cors, shareDeleteRetentionPolicy, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new FileServicesSetServicePropertiesOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.Get");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var response = _restClient.GetServiceProperties(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken);
+ return Response.FromValue(new FileService(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.Get");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var response = await _restClient.GetServicePropertiesAsync(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken);
+ return Response.FromValue(new FileService(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new FileServiceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new FileServiceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new FileServiceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new FileServiceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of FileService for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(FileServiceOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of FileService for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileServiceContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(FileServiceOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/FileServiceOperations.cs b/samples/Azure.Management.Storage/Generated/FileServiceOperations.cs
index fe650e5bd4b..09b6cdf6f2b 100644
--- a/samples/Azure.Management.Storage/Generated/FileServiceOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/FileServiceOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific FileService.
public partial class FileServiceOperations : ResourceOperationsBase
{
- /// Initializes a new instance of FileServiceOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected FileServiceOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a FileService.
+ internal FileServiceOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected FileServiceOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/FileShareContainer.cs b/samples/Azure.Management.Storage/Generated/FileShareContainer.cs
index 15259630309..8e73b6d89d6 100644
--- a/samples/Azure.Management.Storage/Generated/FileShareContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/FileShareContainer.cs
@@ -5,23 +5,357 @@
#nullable disable
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of FileShare and their operations over a StorageAccount.
- public partial class FileShareContainer
+ public partial class FileShareContainer : ResourceContainerBase
{
- /// Initializes a new instance of FileShareContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected FileShareContainer()
{
}
- internal FileShareContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of FileShareContainer class.
+ /// The resource representing the parent resource.
+ internal FileShareContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private FileSharesRestOperations _restClient => new FileSharesRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a FileShare. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the file share to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string shareName, FileShareData fileShare, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (shareName == null)
+ {
+ throw new ArgumentNullException(nameof(shareName));
+ }
+ if (fileShare == null)
+ {
+ throw new ArgumentNullException(nameof(fileShare));
+ }
+
+ return StartCreateOrUpdate(shareName, fileShare, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a FileShare. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the file share to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string shareName, FileShareData fileShare, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (shareName == null)
+ {
+ throw new ArgumentNullException(nameof(shareName));
+ }
+ if (fileShare == null)
+ {
+ throw new ArgumentNullException(nameof(fileShare));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(shareName, fileShare, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a FileShare. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the file share to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string shareName, FileShareData fileShare, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (shareName == null)
+ {
+ throw new ArgumentNullException(nameof(shareName));
+ }
+ if (fileShare == null)
+ {
+ throw new ArgumentNullException(nameof(fileShare));
+ }
+
+ var originalResponse = _restClient.Create(Id.ResourceGroupName, Id.Parent.Name, shareName, fileShare, cancellationToken: cancellationToken);
+ return new FileSharesCreateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a FileShare. Please note some properties can be set only during creation.
+ /// 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.
+ /// Properties of the file share to create.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string shareName, FileShareData fileShare, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (shareName == null)
+ {
+ throw new ArgumentNullException(nameof(shareName));
+ }
+ if (fileShare == null)
+ {
+ throw new ArgumentNullException(nameof(fileShare));
+ }
+
+ var originalResponse = await _restClient.CreateAsync(Id.ResourceGroupName, Id.Parent.Name, shareName, fileShare, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new FileSharesCreateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.Get");
+ scope.Start();
+ try
+ {
+ if (shareName == null)
+ {
+ throw new ArgumentNullException(nameof(shareName));
+ }
+
+ var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, shareName, cancellationToken: cancellationToken);
+ return Response.FromValue(new FileShare(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.Get");
+ scope.Start();
+ try
+ {
+ if (shareName == null)
+ {
+ throw new ArgumentNullException(nameof(shareName));
+ }
+
+ var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Name, shareName, cancellationToken: cancellationToken);
+ return Response.FromValue(new FileShare(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.List(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new FileShare(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.ListNextPage(nextLink, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new FileShare(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new FileShareOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListAsync(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new FileShare(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListNextPageAsync(nextLink, Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new FileShare(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new FileShareOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of FileShare for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(FileShareOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of FileShare for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("FileShareContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(FileShareOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/FileShareOperations.cs b/samples/Azure.Management.Storage/Generated/FileShareOperations.cs
index 01a6679daa7..8f71c2057fb 100644
--- a/samples/Azure.Management.Storage/Generated/FileShareOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/FileShareOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific FileShare.
public partial class FileShareOperations : ResourceOperationsBase
{
- /// Initializes a new instance of FileShareOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected FileShareOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a FileShare.
+ internal FileShareOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected FileShareOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs b/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs
index 1d0a1215772..d9f8fb52344 100644
--- a/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/ManagementPolicyContainer.cs
@@ -5,23 +5,262 @@
#nullable disable
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of ManagementPolicy and their operations over a StorageAccount.
- public partial class ManagementPolicyContainer
+ public partial class ManagementPolicyContainer : ResourceContainerBase
{
- /// Initializes a new instance of ManagementPolicyContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected ManagementPolicyContainer()
{
}
- internal ManagementPolicyContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of ManagementPolicyContainer class.
+ /// The resource representing the parent resource.
+ internal ManagementPolicyContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private ManagementPoliciesRestOperations _restClient => new ManagementPoliciesRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a ManagementPolicy. Please note some properties can be set only during creation.
+ /// The name of the Storage Account Management Policy. It should always be 'default'.
+ /// The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(ManagementPolicyName managementPolicyName, ManagementPolicySchema policy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ return StartCreateOrUpdate(managementPolicyName, policy, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a ManagementPolicy. Please note some properties can be set only during creation.
+ /// The name of the Storage Account Management Policy. It should always be 'default'.
+ /// The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(ManagementPolicyName managementPolicyName, ManagementPolicySchema policy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var operation = await StartCreateOrUpdateAsync(managementPolicyName, policy, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a ManagementPolicy. Please note some properties can be set only during creation.
+ /// The name of the Storage Account Management Policy. It should always be 'default'.
+ /// The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(ManagementPolicyName managementPolicyName, ManagementPolicySchema policy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = _restClient.CreateOrUpdate(Id.ResourceGroupName, Id.Parent.Name, managementPolicyName, policy, cancellationToken: cancellationToken);
+ return new ManagementPoliciesCreateOrUpdateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a ManagementPolicy. Please note some properties can be set only during creation.
+ /// The name of the Storage Account Management Policy. It should always be 'default'.
+ /// The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(ManagementPolicyName managementPolicyName, ManagementPolicySchema policy = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var originalResponse = await _restClient.CreateOrUpdateAsync(Id.ResourceGroupName, Id.Parent.Name, managementPolicyName, policy, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new ManagementPoliciesCreateOrUpdateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ 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.Parent.Name, managementPolicyName, cancellationToken: cancellationToken);
+ return Response.FromValue(new ManagementPolicy(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ 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.Parent.Name, managementPolicyName, cancellationToken: cancellationToken);
+ return Response.FromValue(new ManagementPolicy(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new ManagementPolicyOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new ManagementPolicyOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new ManagementPolicyOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new ManagementPolicyOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of ManagementPolicy for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(ManagementPolicyOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of ManagementPolicy for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ManagementPolicyContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(ManagementPolicyOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/ManagementPolicyOperations.cs b/samples/Azure.Management.Storage/Generated/ManagementPolicyOperations.cs
index 2b9de20fc67..afc01984cf3 100644
--- a/samples/Azure.Management.Storage/Generated/ManagementPolicyOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/ManagementPolicyOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific ManagementPolicy.
public partial class ManagementPolicyOperations : ResourceOperationsBase
{
- /// Initializes a new instance of ManagementPolicyOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected ManagementPolicyOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a ManagementPolicy.
+ internal ManagementPolicyOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected ManagementPolicyOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/Models/FileShareItems.Serialization.cs b/samples/Azure.Management.Storage/Generated/Models/FileShareItems.Serialization.cs
index 3759a230eda..1a875a67d50 100644
--- a/samples/Azure.Management.Storage/Generated/Models/FileShareItems.Serialization.cs
+++ b/samples/Azure.Management.Storage/Generated/Models/FileShareItems.Serialization.cs
@@ -15,7 +15,7 @@ internal partial class FileShareItems
{
internal static FileShareItems DeserializeFileShareItems(JsonElement element)
{
- Optional> value = default;
+ Optional> value = default;
Optional nextLink = default;
foreach (var property in element.EnumerateObject())
{
@@ -26,10 +26,10 @@ internal static FileShareItems DeserializeFileShareItems(JsonElement element)
property.ThrowNonNullablePropertyIsNull();
continue;
}
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(FileShareItem.DeserializeFileShareItem(item));
+ array.Add(FileShareData.DeserializeFileShareData(item));
}
value = array;
continue;
diff --git a/samples/Azure.Management.Storage/Generated/Models/FileShareItems.cs b/samples/Azure.Management.Storage/Generated/Models/FileShareItems.cs
index 5f18b0ebd6b..631106aa17b 100644
--- a/samples/Azure.Management.Storage/Generated/Models/FileShareItems.cs
+++ b/samples/Azure.Management.Storage/Generated/Models/FileShareItems.cs
@@ -16,20 +16,20 @@ internal partial class FileShareItems
/// Initializes a new instance of FileShareItems.
internal FileShareItems()
{
- Value = new ChangeTrackingList();
+ Value = new ChangeTrackingList();
}
/// Initializes a new instance of FileShareItems.
/// List of file shares returned.
/// Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed maximum page size.
- internal FileShareItems(IReadOnlyList value, string nextLink)
+ internal FileShareItems(IReadOnlyList value, string nextLink)
{
Value = value;
NextLink = nextLink;
}
/// List of file shares returned.
- public IReadOnlyList Value { get; }
+ public IReadOnlyList Value { get; }
/// Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed maximum page size.
public string NextLink { get; }
}
diff --git a/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.Serialization.cs b/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.Serialization.cs
index c16988de6c1..9903cb196ed 100644
--- a/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.Serialization.cs
+++ b/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.Serialization.cs
@@ -15,7 +15,7 @@ internal partial class ListContainerItems
{
internal static ListContainerItems DeserializeListContainerItems(JsonElement element)
{
- Optional> value = default;
+ Optional> value = default;
Optional nextLink = default;
foreach (var property in element.EnumerateObject())
{
@@ -26,10 +26,10 @@ internal static ListContainerItems DeserializeListContainerItems(JsonElement ele
property.ThrowNonNullablePropertyIsNull();
continue;
}
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(ListContainerItem.DeserializeListContainerItem(item));
+ array.Add(BlobContainerData.DeserializeBlobContainerData(item));
}
value = array;
continue;
diff --git a/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.cs b/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.cs
index b874851eac3..6b9783fe613 100644
--- a/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.cs
+++ b/samples/Azure.Management.Storage/Generated/Models/ListContainerItems.cs
@@ -16,20 +16,20 @@ internal partial class ListContainerItems
/// Initializes a new instance of ListContainerItems.
internal ListContainerItems()
{
- Value = new ChangeTrackingList();
+ Value = new ChangeTrackingList();
}
/// Initializes a new instance of ListContainerItems.
/// List of blobs containers returned.
/// Request URL that can be used to query next page of containers. Returned when total number of requested containers exceed maximum page size.
- internal ListContainerItems(IReadOnlyList value, string nextLink)
+ internal ListContainerItems(IReadOnlyList value, string nextLink)
{
Value = value;
NextLink = nextLink;
}
/// List of blobs containers returned.
- public IReadOnlyList Value { get; }
+ public IReadOnlyList Value { get; }
/// Request URL that can be used to query next page of containers. Returned when total number of requested containers exceed maximum page size.
public string NextLink { get; }
}
diff --git a/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs b/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs
index 46b9036d803..29e65c337d6 100644
--- a/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyContainer.cs
@@ -5,23 +5,327 @@
#nullable disable
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of ObjectReplicationPolicy and their operations over a StorageAccount.
- public partial class ObjectReplicationPolicyContainer
+ public partial class ObjectReplicationPolicyContainer : ResourceContainerBase
{
- /// Initializes a new instance of ObjectReplicationPolicyContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected ObjectReplicationPolicyContainer()
{
}
- internal ObjectReplicationPolicyContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of ObjectReplicationPolicyContainer class.
+ /// The resource representing the parent resource.
+ internal ObjectReplicationPolicyContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private ObjectReplicationPoliciesRestOperations _restClient => new ObjectReplicationPoliciesRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a ObjectReplicationPolicy. Please note some properties can be set only during creation.
+ /// The ID of object replication policy or 'default' if the policy ID is unknown.
+ /// The object replication policy set to a storage account. A unique policy ID will be created if absent.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string objectReplicationPolicyId, ObjectReplicationPolicyData properties, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (objectReplicationPolicyId == null)
+ {
+ throw new ArgumentNullException(nameof(objectReplicationPolicyId));
+ }
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
+ return StartCreateOrUpdate(objectReplicationPolicyId, properties, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a ObjectReplicationPolicy. Please note some properties can be set only during creation.
+ /// The ID of object replication policy or 'default' if the policy ID is unknown.
+ /// The object replication policy set to a storage account. A unique policy ID will be created if absent.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string objectReplicationPolicyId, ObjectReplicationPolicyData properties, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (objectReplicationPolicyId == null)
+ {
+ throw new ArgumentNullException(nameof(objectReplicationPolicyId));
+ }
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(objectReplicationPolicyId, properties, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a ObjectReplicationPolicy. Please note some properties can be set only during creation.
+ /// The ID of object replication policy or 'default' if the policy ID is unknown.
+ /// The object replication policy set to a storage account. A unique policy ID will be created if absent.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string objectReplicationPolicyId, ObjectReplicationPolicyData properties, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (objectReplicationPolicyId == null)
+ {
+ throw new ArgumentNullException(nameof(objectReplicationPolicyId));
+ }
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
+ var originalResponse = _restClient.CreateOrUpdate(Id.ResourceGroupName, Id.Parent.Name, objectReplicationPolicyId, properties, cancellationToken: cancellationToken);
+ return new ObjectReplicationPoliciesCreateOrUpdateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a ObjectReplicationPolicy. Please note some properties can be set only during creation.
+ /// The ID of object replication policy or 'default' if the policy ID is unknown.
+ /// The object replication policy set to a storage account. A unique policy ID will be created if absent.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string objectReplicationPolicyId, ObjectReplicationPolicyData properties, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (objectReplicationPolicyId == null)
+ {
+ throw new ArgumentNullException(nameof(objectReplicationPolicyId));
+ }
+ if (properties == null)
+ {
+ throw new ArgumentNullException(nameof(properties));
+ }
+
+ var originalResponse = await _restClient.CreateOrUpdateAsync(Id.ResourceGroupName, Id.Parent.Name, objectReplicationPolicyId, properties, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new ObjectReplicationPoliciesCreateOrUpdateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.Get");
+ scope.Start();
+ try
+ {
+ if (objectReplicationPolicyId == null)
+ {
+ throw new ArgumentNullException(nameof(objectReplicationPolicyId));
+ }
+
+ var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, objectReplicationPolicyId, cancellationToken: cancellationToken);
+ return Response.FromValue(new ObjectReplicationPolicy(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.Get");
+ scope.Start();
+ try
+ {
+ if (objectReplicationPolicyId == null)
+ {
+ throw new ArgumentNullException(nameof(objectReplicationPolicyId));
+ }
+
+ var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Name, objectReplicationPolicyId, cancellationToken: cancellationToken);
+ return Response.FromValue(new ObjectReplicationPolicy(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.List(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new ObjectReplicationPolicy(Parent, value)), null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new ObjectReplicationPolicyOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListAsync(Id.ResourceGroupName, Id.Parent.Name, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new ObjectReplicationPolicy(Parent, value)), null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new ObjectReplicationPolicyOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of ObjectReplicationPolicy for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(ObjectReplicationPolicyOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of ObjectReplicationPolicy for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("ObjectReplicationPolicyContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(ObjectReplicationPolicyOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyOperations.cs b/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyOperations.cs
index 9f015cf7a00..3e336263ad0 100644
--- a/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/ObjectReplicationPolicyOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific ObjectReplicationPolicy.
public partial class ObjectReplicationPolicyOperations : ResourceOperationsBase
{
- /// Initializes a new instance of ObjectReplicationPolicyOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected ObjectReplicationPolicyOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a ObjectReplicationPolicy.
+ internal ObjectReplicationPolicyOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected ObjectReplicationPolicyOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs b/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs
index 39b418a50d1..e0729891e45 100644
--- a/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionContainer.cs
@@ -5,23 +5,286 @@
#nullable disable
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of PrivateEndpointConnection and their operations over a StorageAccount.
- public partial class PrivateEndpointConnectionContainer
+ public partial class PrivateEndpointConnectionContainer : ResourceContainerBase
{
- /// Initializes a new instance of PrivateEndpointConnectionContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected PrivateEndpointConnectionContainer()
{
}
- internal PrivateEndpointConnectionContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of PrivateEndpointConnectionContainer class.
+ /// The resource representing the parent resource.
+ internal PrivateEndpointConnectionContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private PrivateEndpointConnectionsRestOperations _restClient => new PrivateEndpointConnectionsRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a PrivateEndpointConnection. Please note some properties can be set only during creation.
+ /// The name of the private endpoint connection associated with the Storage Account.
+ /// The resource of private end point.
+ /// A collection of information about the state of the connection between service consumer and provider.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = null, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (privateEndpointConnectionName == null)
+ {
+ throw new ArgumentNullException(nameof(privateEndpointConnectionName));
+ }
+
+ return StartCreateOrUpdate(privateEndpointConnectionName, privateEndpoint, privateLinkServiceConnectionState, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a PrivateEndpointConnection. Please note some properties can be set only during creation.
+ /// The name of the private endpoint connection associated with the Storage Account.
+ /// The resource of private end point.
+ /// A collection of information about the state of the connection between service consumer and provider.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = null, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (privateEndpointConnectionName == null)
+ {
+ throw new ArgumentNullException(nameof(privateEndpointConnectionName));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(privateEndpointConnectionName, privateEndpoint, privateLinkServiceConnectionState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a PrivateEndpointConnection. Please note some properties can be set only during creation.
+ /// The name of the private endpoint connection associated with the Storage Account.
+ /// The resource of private end point.
+ /// A collection of information about the state of the connection between service consumer and provider.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = null, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (privateEndpointConnectionName == null)
+ {
+ throw new ArgumentNullException(nameof(privateEndpointConnectionName));
+ }
+
+ var originalResponse = _restClient.Put(Id.ResourceGroupName, Id.Parent.Name, privateEndpointConnectionName, privateEndpoint, privateLinkServiceConnectionState, cancellationToken: cancellationToken);
+ return new PrivateEndpointConnectionsPutOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a PrivateEndpointConnection. Please note some properties can be set only during creation.
+ /// The name of the private endpoint connection associated with the Storage Account.
+ /// The resource of private end point.
+ /// A collection of information about the state of the connection between service consumer and provider.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string privateEndpointConnectionName, PrivateEndpoint privateEndpoint = null, PrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (privateEndpointConnectionName == null)
+ {
+ throw new ArgumentNullException(nameof(privateEndpointConnectionName));
+ }
+
+ var originalResponse = await _restClient.PutAsync(Id.ResourceGroupName, Id.Parent.Name, privateEndpointConnectionName, privateEndpoint, privateLinkServiceConnectionState, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new PrivateEndpointConnectionsPutOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.Get");
+ scope.Start();
+ try
+ {
+ if (privateEndpointConnectionName == null)
+ {
+ throw new ArgumentNullException(nameof(privateEndpointConnectionName));
+ }
+
+ var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, privateEndpointConnectionName, cancellationToken: cancellationToken);
+ return Response.FromValue(new PrivateEndpointConnection(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.Get");
+ scope.Start();
+ try
+ {
+ if (privateEndpointConnectionName == null)
+ {
+ throw new ArgumentNullException(nameof(privateEndpointConnectionName));
+ }
+
+ var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Parent.Name, privateEndpointConnectionName, cancellationToken: cancellationToken);
+ return Response.FromValue(new PrivateEndpointConnection(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new PrivateEndpointConnectionOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new PrivateEndpointConnectionOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new PrivateEndpointConnectionOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new PrivateEndpointConnectionOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of PrivateEndpointConnection for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(PrivateEndpointConnectionOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of PrivateEndpointConnection for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(PrivateEndpointConnectionOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionOperations.cs b/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionOperations.cs
index cbbb9fadb63..5f3680a7e79 100644
--- a/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/PrivateEndpointConnectionOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific PrivateEndpointConnection.
public partial class PrivateEndpointConnectionOperations : ResourceOperationsBase
{
- /// Initializes a new instance of PrivateEndpointConnectionOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected PrivateEndpointConnectionOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a PrivateEndpointConnection.
+ internal PrivateEndpointConnectionOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected PrivateEndpointConnectionOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/PrivateLinkResourceContainer.cs b/samples/Azure.Management.Storage/Generated/PrivateLinkResourceContainer.cs
index 25d5c20b6e4..06a704f69fd 100644
--- a/samples/Azure.Management.Storage/Generated/PrivateLinkResourceContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/PrivateLinkResourceContainer.cs
@@ -5,23 +5,134 @@
#nullable disable
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of PrivateLinkResource and their operations over a StorageAccount.
- public partial class PrivateLinkResourceContainer
+ public partial class PrivateLinkResourceContainer : ContainerBase
{
- /// Initializes a new instance of PrivateLinkResourceContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected PrivateLinkResourceContainer()
{
}
- internal PrivateLinkResourceContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of PrivateLinkResourceContainer class.
+ /// The resource representing the parent resource.
+ internal PrivateLinkResourceContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private PrivateLinkResourcesRestOperations _restClient => new PrivateLinkResourcesRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+ protected override ResourceType ValidResourceType => StorageAccountOperations.ResourceType;
+
+ // Container level operations.
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new PrivateLinkResourceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new PrivateLinkResourceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new PrivateLinkResourceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new PrivateLinkResourceOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of PrivateLinkResource for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourceContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(PrivateLinkResourceOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of PrivateLinkResource for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("PrivateLinkResourceContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(PrivateLinkResourceOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/PrivateLinkResourceOperations.cs b/samples/Azure.Management.Storage/Generated/PrivateLinkResourceOperations.cs
index 16b18610c2d..49dc4b1d20a 100644
--- a/samples/Azure.Management.Storage/Generated/PrivateLinkResourceOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/PrivateLinkResourceOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific PrivateLinkResource.
public partial class PrivateLinkResourceOperations : ResourceOperationsBase
{
- /// Initializes a new instance of PrivateLinkResourceOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected PrivateLinkResourceOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a PrivateLinkResource.
+ internal PrivateLinkResourceOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected PrivateLinkResourceOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs b/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs
index 1aad2eb7521..d7a68cf7984 100644
--- a/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs
+++ b/samples/Azure.Management.Storage/Generated/StorageAccountContainer.cs
@@ -5,23 +5,339 @@
#nullable disable
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
+using Azure.Management.Storage.Models;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.Management.Storage
{
/// A class representing collection of StorageAccount and their operations over a Parent.
- public partial class StorageAccountContainer
+ public partial class StorageAccountContainer : ResourceContainerBase
{
- /// Initializes a new instance of StorageAccountContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected StorageAccountContainer()
{
}
- internal StorageAccountContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of StorageAccountContainer class.
+ /// The resource representing the parent resource.
+ internal StorageAccountContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private StorageAccountsRestOperations _restClient => new StorageAccountsRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => "any";
+ protected override ResourceType ValidResourceType => "any";
+
+ // Container level operations.
+
+ /// The operation to create or update a StorageAccount. Please note some properties can be set only during creation.
+ /// 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.
+ /// The parameters to provide for the created account.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string accountName, StorageAccountCreateParameters parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ return StartCreateOrUpdate(accountName, parameters, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a StorageAccount. Please note some properties can be set only during creation.
+ /// 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.
+ /// The parameters to provide for the created account.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string accountName, StorageAccountCreateParameters parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(accountName, parameters, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a StorageAccount. Please note some properties can be set only during creation.
+ /// 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.
+ /// The parameters to provide for the created account.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string accountName, StorageAccountCreateParameters parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var originalResponse = _restClient.Create(Id.ResourceGroupName, accountName, parameters, cancellationToken: cancellationToken);
+ var operation = new StorageAccountsCreateOperation(
+ _clientDiagnostics, _pipeline, _restClient.CreateCreateRequest(
+ Id.ResourceGroupName, accountName, parameters).Request,
+ originalResponse);
+ return new PhArmOperation(
+ operation,
+ data => new StorageAccount(Parent, data));
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a StorageAccount. Please note some properties can be set only during creation.
+ /// 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.
+ /// The parameters to provide for the created account.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string accountName, StorageAccountCreateParameters parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var originalResponse = await _restClient.CreateAsync(Id.ResourceGroupName, accountName, parameters, cancellationToken: cancellationToken).ConfigureAwait(false);
+ var operation = new StorageAccountsCreateOperation(
+ _clientDiagnostics, _pipeline, _restClient.CreateCreateRequest(
+ Id.ResourceGroupName, accountName, parameters).Request,
+ originalResponse);
+ return new PhArmOperation(
+ operation,
+ data => new StorageAccount(Parent, data));
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.Get");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var response = _restClient.GetProperties(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken);
+ return Response.FromValue(new StorageAccount(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.Get");
+ scope.Start();
+ try
+ {
+ if (accountName == null)
+ {
+ throw new ArgumentNullException(nameof(accountName));
+ }
+
+ var response = await _restClient.GetPropertiesAsync(Id.ResourceGroupName, accountName, cancellationToken: cancellationToken);
+ return Response.FromValue(new StorageAccount(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.ListByResourceGroup");
+ scope.Start();
+ try
+ {
+ var response = _restClient.ListByResourceGroup(Id.ResourceGroupName, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new StorageAccount(Parent, value)), null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new StorageAccountOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.ListByResourceGroup");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListByResourceGroupAsync(Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new StorageAccount(Parent, value)), null, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResourceAsync(null, top, cancellationToken);
+ return new PhWrappingAsyncPageable(results, genericResource => new StorageAccountOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of StorageAccount for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of resource that may take multiple service requests to iterate over.
+ public Pageable ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(StorageAccountOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of StorageAccount for this resource group represented as generic resources.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of resource that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("StorageAccountContainer.ListAsGenericResource");
+ scope.Start();
+ try
+ {
+ var filters = new ResourceFilterCollection(StorageAccountOperations.ResourceType);
+ filters.SubstringFilter = nameFilter;
+ return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // Builders.
+ // public ArmBuilder Construct() { }
}
}
diff --git a/samples/Azure.Management.Storage/Generated/StorageAccountOperations.cs b/samples/Azure.Management.Storage/Generated/StorageAccountOperations.cs
index 083fbbd580f..ba561845687 100644
--- a/samples/Azure.Management.Storage/Generated/StorageAccountOperations.cs
+++ b/samples/Azure.Management.Storage/Generated/StorageAccountOperations.cs
@@ -17,12 +17,18 @@ namespace Azure.Management.Storage
/// A class representing the operations that can be performed over a specific StorageAccount.
public partial class StorageAccountOperations : ResourceOperationsBase
{
- /// Initializes a new instance of StorageAccountOperations for mocking.
+ /// Initializes a new instance of the class for mocking.
protected StorageAccountOperations()
{
}
- /// Initializes a new instance of class.
+ /// Initializes a new instance of the class.
+ /// An instance of that has an id for a StorageAccount.
+ internal StorageAccountOperations(GenericResourceOperations genericOperations) : base(genericOperations, genericOperations.Id)
+ {
+ }
+
+ /// Initializes a new instance of the class.
/// The client parameters to use in these operations.
/// The identifier of the resource that is the target of operations.
protected StorageAccountOperations(ResourceOperationsBase options, ResourceGroupResourceIdentifier id) : base(options, id)
diff --git a/samples/Azure.Management.Storage/readme.md b/samples/Azure.Management.Storage/readme.md
index a69694e05ef..3079e045075 100644
--- a/samples/Azure.Management.Storage/readme.md
+++ b/samples/Azure.Management.Storage/readme.md
@@ -42,4 +42,10 @@ directive:
- rename-model:
from: FileServiceProperties
to: FileService
+ - from: swagger-document
+ where: $.definitions.FileShareItems.properties.value.items["$ref"]
+ transform: return "#/definitions/FileShare"
+ - from: swagger-document
+ where: $.definitions.ListContainerItems.properties.value.items["$ref"]
+ transform: return "#/definitions/BlobContainer"
```
diff --git a/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs b/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs
index 23822c3a6be..bf6fd2da34b 100644
--- a/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs
+++ b/samples/Azure.ResourceManager.Sample/Generated/AvailabilitySetContainer.cs
@@ -5,23 +5,356 @@
#nullable disable
+using System;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure;
+using Azure.Core;
+using Azure.Core.Pipeline;
using Azure.ResourceManager.Core;
+using Azure.ResourceManager.Core.Resources;
namespace Azure.ResourceManager.Sample
{
/// A class representing collection of AvailabilitySet and their operations over a ResourceGroup.
- public partial class AvailabilitySetContainer
+ public partial class AvailabilitySetContainer : ResourceContainerBase
{
- /// Initializes a new instance of AvailabilitySetContainer for mocking.
+ /// Initializes a new instance of the class for mocking.
protected AvailabilitySetContainer()
{
}
- internal AvailabilitySetContainer(ResourceOperationsBase parent)
+ /// Initializes a new instance of AvailabilitySetContainer class.
+ /// The resource representing the parent resource.
+ internal AvailabilitySetContainer(ResourceOperationsBase parent) : base(parent)
{
+ _clientDiagnostics = new ClientDiagnostics(ClientOptions);
+ _pipeline = ManagementPipelineBuilder.Build(Credential, BaseUri, ClientOptions);
}
+ private readonly ClientDiagnostics _clientDiagnostics;
+ private readonly HttpPipeline _pipeline;
+
+ /// Represents the REST operations.
+ private AvailabilitySetsRestOperations _restClient => new AvailabilitySetsRestOperations(_clientDiagnostics, _pipeline, Id.SubscriptionId);
+
+ /// Typed Resource Identifier for the container.
+ public new ResourceGroupResourceIdentifier Id => base.Id as ResourceGroupResourceIdentifier;
+
/// Gets the valid resource type for this object.
- protected ResourceType ValidResourceType => ResourceGroupOperations.ResourceType;
+ protected override ResourceType ValidResourceType => ResourceGroupOperations.ResourceType;
+
+ // Container level operations.
+
+ /// The operation to create or update a AvailabilitySet. Please note some properties can be set only during creation.
+ /// The name of the availability set.
+ /// Parameters supplied to the Create Availability Set operation.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Response CreateOrUpdate(string availabilitySetName, AvailabilitySetData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (availabilitySetName == null)
+ {
+ throw new ArgumentNullException(nameof(availabilitySetName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ return StartCreateOrUpdate(availabilitySetName, parameters, cancellationToken: cancellationToken).WaitForCompletion() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a AvailabilitySet. Please note some properties can be set only during creation.
+ /// The name of the availability set.
+ /// Parameters supplied to the Create Availability Set operation.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> CreateOrUpdateAsync(string availabilitySetName, AvailabilitySetData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (availabilitySetName == null)
+ {
+ throw new ArgumentNullException(nameof(availabilitySetName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var operation = await StartCreateOrUpdateAsync(availabilitySetName, parameters, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return await operation.WaitForCompletionAsync() as Response;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a AvailabilitySet. Please note some properties can be set only during creation.
+ /// The name of the availability set.
+ /// Parameters supplied to the Create Availability Set operation.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public Operation StartCreateOrUpdate(string availabilitySetName, AvailabilitySetData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (availabilitySetName == null)
+ {
+ throw new ArgumentNullException(nameof(availabilitySetName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var originalResponse = _restClient.CreateOrUpdate(Id.ResourceGroupName, availabilitySetName, parameters, cancellationToken: cancellationToken);
+ return new AvailabilitySetsCreateOrUpdateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The operation to create or update a AvailabilitySet. Please note some properties can be set only during creation.
+ /// The name of the availability set.
+ /// Parameters supplied to the Create Availability Set operation.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ public async Task> StartCreateOrUpdateAsync(string availabilitySetName, AvailabilitySetData parameters, CancellationToken cancellationToken = default)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.StartCreateOrUpdate");
+ scope.Start();
+ try
+ {
+ if (availabilitySetName == null)
+ {
+ throw new ArgumentNullException(nameof(availabilitySetName));
+ }
+ if (parameters == null)
+ {
+ throw new ArgumentNullException(nameof(parameters));
+ }
+
+ var originalResponse = await _restClient.CreateOrUpdateAsync(Id.ResourceGroupName, availabilitySetName, parameters, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return new AvailabilitySetsCreateOrUpdateOperation(Parent, originalResponse);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get");
+ scope.Start();
+ try
+ {
+ if (availabilitySetName == null)
+ {
+ throw new ArgumentNullException(nameof(availabilitySetName));
+ }
+
+ var response = _restClient.Get(Id.ResourceGroupName, availabilitySetName, cancellationToken: cancellationToken);
+ return Response.FromValue(new AvailabilitySet(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// 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)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.Get");
+ scope.Start();
+ try
+ {
+ if (availabilitySetName == null)
+ {
+ throw new ArgumentNullException(nameof(availabilitySetName));
+ }
+
+ var response = await _restClient.GetAsync(Id.ResourceGroupName, availabilitySetName, cancellationToken: cancellationToken);
+ return Response.FromValue(new AvailabilitySet(Parent, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(int? top = null, CancellationToken cancellationToken = default)
+ {
+ Page FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.List(Id.ResourceGroupName, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new AvailabilitySet(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ Page NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.List");
+ scope.Start();
+ try
+ {
+ var response = _restClient.ListNextPage(nextLink, Id.ResourceGroupName, cancellationToken: cancellationToken);
+ return Page.FromValues(response.Value.Value.Select(value => new AvailabilitySet(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of for this resource group. Makes an additional network call to retrieve the full data model for each resource group.
+ /// The filter used in this operation.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// A collection of that may take multiple service requests to iterate over.
+ public Pageable List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
+ {
+ var results = ListAsGenericResource(null, top, cancellationToken);
+ return new PhWrappingPageable(results, genericResource => new AvailabilitySetOperations(genericResource).Get().Value);
+ }
+
+ /// Filters the list of for this resource group.
+ /// The number of results to return.
+ /// A token to allow the caller to cancel the call to the service. The default value is .
+ /// An async collection of that may take multiple service requests to iterate over.
+ public AsyncPageable ListAsync(int? top = null, CancellationToken cancellationToken = default)
+ {
+ async Task> FirstPageFunc(int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListAsync(Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new AvailabilitySet(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ async Task> NextPageFunc(string nextLink, int? pageSizeHint)
+ {
+ using var scope = _clientDiagnostics.CreateScope("AvailabilitySetContainer.List");
+ scope.Start();
+ try
+ {
+ var response = await _restClient.ListNextPageAsync(nextLink, Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ return Page.FromValues(response.Value.Value.Select(value => new AvailabilitySet(Parent, value)), response.Value.NextLink, response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
+ }
+
+ /// Filters the list of