Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename list operations #19386

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -78,58 +78,58 @@ public ArmBuilder<AvailabilitySet, AvailabilitySetData> Construct(string skuName
}

/// <summary>
/// Filters the list of availabitlity set for this resource group represented as generic resources.
/// Filters the list of availability set for this resource group represented as generic resources.
/// </summary>
/// <param name="filter"> The filter used in this operation. </param>
/// <param name="nameFilter"> The filter used in this operation. </param>
/// <param name="top"> The number of results to return. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> A collection of resource that may take multiple service requests to iterate over. </returns>
public Pageable<GenericResource> ListByName(string filter, int? top = null, CancellationToken cancellationToken = default)
public Pageable<GenericResource> ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
ResourceFilterCollection filters = new ResourceFilterCollection(AvailabilitySetData.ResourceType);
filters.SubstringFilter = filter;
filters.SubstringFilter = nameFilter;
return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
}

/// <summary>
/// Filters the list of availabitlity set for this resource group represented as generic resources.
/// Filters the list of availability set for this resource group represented as generic resources.
/// </summary>
/// <param name="filter"> The filter used in this operation. </param>
/// <param name="nameFilter"> The filter used in this operation. </param>
/// <param name="top"> The number of results to return. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> An async collection of resource that may take multiple service requests to iterate over. </returns>
public AsyncPageable<GenericResource> ListByNameAsync(string filter, int? top = null, CancellationToken cancellationToken = default)
public AsyncPageable<GenericResource> ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
ResourceFilterCollection filters = new ResourceFilterCollection(AvailabilitySetData.ResourceType);
filters.SubstringFilter = filter;
filters.SubstringFilter = nameFilter;
return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
}

/// <summary>
/// Filters the list of availabitlity set for this resource group.
/// Filters the list of availability set for this resource group.
/// Makes an additional network call to retrieve the full data model for each resource group.
/// </summary>
/// <param name="filter"> The filter used in this operation. </param>
/// <param name="nameFilter"> The filter used in this operation. </param>
/// <param name="top"> The number of results to return. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> A collection of availability set that may take multiple service requests to iterate over. </returns>
public Pageable<AvailabilitySet> ListByNameExpanded(string filter, int? top = null, CancellationToken cancellationToken = default)
public Pageable<AvailabilitySet> List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
var results = ListByName(filter, top, cancellationToken);
var results = ListAsGenericResource(nameFilter, top, cancellationToken);
return new PhWrappingPageable<GenericResource, AvailabilitySet>(results, s => new AvailabilitySetOperations(s).Get().Value);
}

/// <summary>
/// Filters the list of availabitlity set for this resource group.
/// Filters the list of availability set for this resource group.
/// Makes an additional network call to retrieve the full data model for each resource group.
/// </summary>
/// <param name="filter"> The filter used in this operation. </param>
/// <param name="nameFilter"> The filter used in this operation. </param>
/// <param name="top"> The number of results to return. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> An asyc collection of availability set that may take multiple service requests to iterate over. </returns>
public AsyncPageable<AvailabilitySet> ListByNameExpandedAsync(string filter, int? top = null, CancellationToken cancellationToken = default)
public AsyncPageable<AvailabilitySet> ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
var results = ListByNameAsync(filter, top, cancellationToken);
var results = ListAsGenericResourceAsync(nameFilter, top, cancellationToken);
return new PhWrappingAsyncPageable<GenericResource, AvailabilitySet>(results, s => new AvailabilitySetOperations(s).Get().Value);
}

Expand Down
24 changes: 12 additions & 12 deletions sdk/resourcemanager/Proto.Client/compute/VirtualMachineContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,56 +168,56 @@ public AsyncPageable<VirtualMachine> ListAsync(CancellationToken cancellationTok
/// <summary>
/// Filters the list of virtual machines for this resource group represented as generic resources.
/// </summary>
/// <param name="filter"> The substring to filter by. </param>
/// <param name="nameFilter"> The substring to filter by. </param>
/// <param name="top"> The number of items to truncate by. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> A collection of <see cref="GenericResource"/> that may take multiple service requests to iterate over. </returns>
public Pageable<GenericResource> ListByName(string filter, int? top = null, CancellationToken cancellationToken = default)
public Pageable<GenericResource> ListAsGenericResource(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
ResourceFilterCollection filters = new ResourceFilterCollection(VirtualMachineOperations.ResourceType);
filters.SubstringFilter = filter;
filters.SubstringFilter = nameFilter;
return ResourceListOperations.ListAtContext(Parent as ResourceGroupOperations, filters, top, cancellationToken);
}

/// <summary>
/// Filters the list of virtual machines for this resource group represented as generic resources.
/// </summary>
/// <param name="filter"> The substring to filter by. </param>
/// <param name="nameFilter"> The substring to filter by. </param>
/// <param name="top"> The number of items to truncate by. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> An async collection of <see cref="GenericResource"/> that may take multiple service requests to iterate over. </returns>
public AsyncPageable<GenericResource> ListByNameAsync(string filter, int? top = null, CancellationToken cancellationToken = default)
public AsyncPageable<GenericResource> ListAsGenericResourceAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
ResourceFilterCollection filters = new ResourceFilterCollection(VirtualMachineOperations.ResourceType);
filters.SubstringFilter = filter;
filters.SubstringFilter = nameFilter;
return ResourceListOperations.ListAtContextAsync(Parent as ResourceGroupOperations, filters, top, cancellationToken);
}

/// <summary>
/// Filters the list of virtual machines for this resource group represented as generic resources.
/// Makes an additional network call to retrieve the full data model for each virtual machine.
/// </summary>
/// <param name="filter"> The substring to filter by. </param>
/// <param name="nameFilter"> The substring to filter by. </param>
/// <param name="top"> The number of items to truncate by. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> A collection of <see cref="VirtualMachine"/> that may take multiple service requests to iterate over. </returns>
public Pageable<VirtualMachine> ListByNameExpanded(string filter, int? top = null, CancellationToken cancellationToken = default)
public Pageable<VirtualMachine> List(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
var results = ListByName(filter, top, cancellationToken);
var results = ListAsGenericResource(nameFilter, top, cancellationToken);
return new PhWrappingPageable<GenericResource, VirtualMachine>(results, s => (new VirtualMachineOperations(s)).Get().Value);
}

/// <summary>
/// Filters the list of virtual machines for this resource group represented as generic resources.
/// Makes an additional network call to retrieve the full data model for each virtual machine.
/// </summary>
/// <param name="filter"> The substring to filter by. </param>
/// <param name="nameFilter"> The substring to filter by. </param>
/// <param name="top"> The number of items to truncate by. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="P:System.Threading.CancellationToken.None" />. </param>
/// <returns> An async collection of <see cref="VirtualMachine"/> that may take multiple service requests to iterate over. </returns>
public AsyncPageable<VirtualMachine> ListByNameExpandedAsync(string filter, int? top = null, CancellationToken cancellationToken = default)
public AsyncPageable<VirtualMachine> ListAsync(string nameFilter, int? top = null, CancellationToken cancellationToken = default)
{
var results = ListByNameAsync(filter, top, cancellationToken);
var results = ListAsGenericResourceAsync(nameFilter, top, cancellationToken);
return new PhWrappingAsyncPageable<GenericResource, VirtualMachine>(results, s => (new VirtualMachineOperations(s)).Get().Value);
}

Expand Down
Loading