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

Remove Get/GetAsync from ResourceContainerBase #21963

Merged
merged 1 commit into from
Jun 22, 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.

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 @@ -94,24 +94,6 @@ protected TParent GetParentResource<TParent, TParentId, TParentOperations>()
return _parentResource as TParent;
}

/// <summary>
/// Gets details for this resource from the service.
/// </summary>
/// <param name="resourceName"> The name of the resource to get. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param>
/// <returns> A response with the <see cref="Response{TOperations}"/> operation for this resource. </returns>
/// <exception cref="ArgumentException"> resourceName cannot be null or a whitespace. </exception>
public abstract Response<TOperations> Get(string resourceName, CancellationToken cancellationToken = default);

/// <summary>
/// Gets details for this resource from the service.
/// </summary>
/// <param name="resourceName"> The name of the resource to get. </param>
/// <param name="cancellationToken"> A token to allow the caller to cancel the call to the service. The default value is <see cref="CancellationToken.None" />. </param>
/// <returns> A <see cref="Task"/> that on completion returns a response with the <see cref="Response{TOperations}"/> operation for this resource. </returns>
/// <exception cref="ArgumentException"> resourceName cannot be null or a whitespace. </exception>
public abstract Task<Response<TOperations>> GetAsync(string resourceName, CancellationToken cancellationToken = default);

/// <summary>
/// Returns the resource from Azure if it exists.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal RoleAssignmentContainer(ResourceOperationsBase operations, ResourceIden
/// <param name="resourceName"> The role assignment name. </param>
/// <param name="cancellationToken"> A token that allows cancellation of any blockign API calls made during this method. </param>
/// <returns> The role assignment. </returns>
public override Response<RoleAssignment> Get(string resourceName, CancellationToken cancellationToken = default)
public Response<RoleAssignment> Get(string resourceName, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id, resourceName, cancellationToken);
return Response.FromValue(new RoleAssignment(this, new RoleAssignmentData(response.Value)), response.GetRawResponse());
Expand All @@ -76,7 +76,7 @@ public override Response<RoleAssignment> Get(string resourceName, CancellationTo
/// <param name="resourceName"> The role assignment name. </param>
/// <param name="cancellationToken"> A token that allows cancellation of any blockign API calls made during this method. </param>
/// <returns> The role assignment. </returns>
public async override Task<Response<RoleAssignment>> GetAsync(string resourceName, CancellationToken cancellationToken = default)
public async Task<Response<RoleAssignment>> GetAsync(string resourceName, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id, resourceName, cancellationToken).ConfigureAwait(false);
return Response.FromValue(new RoleAssignment(this, new RoleAssignmentData(response.Value)), response.GetRawResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ public AsyncPageable<GenericResource> ListAsGenericResourceAsync(string nameFilt


/// <inheritdoc />
public override Response<AvailabilitySet> Get(string availabilitySetName, CancellationToken cancellationToken = default)
public Response<AvailabilitySet> Get(string availabilitySetName, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id.ResourceGroupName, availabilitySetName);
return Response.FromValue(new AvailabilitySet(Parent, new AvailabilitySetData(response.Value)), response.GetRawResponse());
}

/// <inheritdoc/>
public override async Task<Response<AvailabilitySet>> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default)
public async Task<Response<AvailabilitySet>> GetAsync(string availabilitySetName, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id.ResourceGroupName, availabilitySetName, cancellationToken).ConfigureAwait(false);
return Response.FromValue(new AvailabilitySet(Parent, new AvailabilitySetData(response.Value)), response.GetRawResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,14 @@ public AsyncPageable<GenericResource> ListAsGenericResourceAsync(string nameFilt
}

/// <inheritdoc />
public override Response<VirtualMachine> Get(string virtualMachineName, CancellationToken cancellationToken = default)
public Response<VirtualMachine> Get(string virtualMachineName, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id.ResourceGroupName, virtualMachineName, cancellationToken);
return Response.FromValue(new VirtualMachine(Parent, new VirtualMachineData(response.Value)), response.GetRawResponse());
}

/// <inheritdoc/>
public override async Task<Response<VirtualMachine>> GetAsync(string virtualMachineName, CancellationToken cancellationToken = default)
public async Task<Response<VirtualMachine>> GetAsync(string virtualMachineName, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id.ResourceGroupName, virtualMachineName, cancellationToken).ConfigureAwait(false);
return Response.FromValue(new VirtualMachine(Parent, new VirtualMachineData(response.Value)), response.GetRawResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ public async Task<Response<VirtualMachineScaleSet>> CreateOrUpdateAsync(string n
}

/// <inheritdoc />
public override Response<VirtualMachineScaleSet> Get(string virtualMachineScaleSetName, CancellationToken cancellationToken = default)
public Response<VirtualMachineScaleSet> Get(string virtualMachineScaleSetName, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id.ResourceGroupName, virtualMachineScaleSetName, cancellationToken);
return Response.FromValue(new VirtualMachineScaleSet(Parent, new VirtualMachineScaleSetData(response.Value)), response.GetRawResponse());
}

/// <inheritdoc/>
public override async Task<Response<VirtualMachineScaleSet>> GetAsync(string virtualMachineScaleSetName, CancellationToken cancellationToken = default)
public async Task<Response<VirtualMachineScaleSet>> GetAsync(string virtualMachineScaleSetName, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id.ResourceGroupName, virtualMachineScaleSetName, cancellationToken).ConfigureAwait(false);
return Response.FromValue(new VirtualMachineScaleSet(Parent, new VirtualMachineScaleSetData(response.Value)), response.GetRawResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ public AsyncPageable<LoadBalancer> ListAsync(CancellationToken cancellationToken
}

/// <inheritdoc/>
public override Response<LoadBalancer> Get(string loadBalancerName, CancellationToken cancellationToken = default)
public Response<LoadBalancer> Get(string loadBalancerName, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id.ResourceGroupName, loadBalancerName, null, cancellationToken: cancellationToken);
return Response.FromValue(new LoadBalancer(Parent, new LoadBalancerData(response.Value)), response.GetRawResponse());

}

/// <inheritdoc/>
public override async Task<Response<LoadBalancer>> GetAsync(string loadBalancerName, CancellationToken cancellationToken = default)
public async Task<Response<LoadBalancer>> GetAsync(string loadBalancerName, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id.ResourceGroupName, loadBalancerName, null, cancellationToken).ConfigureAwait(false);
return Response.FromValue(new LoadBalancer(Parent, new LoadBalancerData(response.Value)), response.GetRawResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ public AsyncPageable<GenericResource> ListAsGenericResourceAsync(string nameFilt
}

/// <inheritdoc />
public override Response<NetworkInterface> Get(string networkInterfaceName, CancellationToken cancellationToken = default)
public Response<NetworkInterface> Get(string networkInterfaceName, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id.ResourceGroupName, networkInterfaceName, cancellationToken: cancellationToken);
return Response.FromValue(new NetworkInterface(Parent, new NetworkInterfaceData(response.Value)), response.GetRawResponse());
}

/// <inheritdoc/>
public override async Task<Response<NetworkInterface>> GetAsync(string networkInterfaceName, CancellationToken cancellationToken = default)
public async Task<Response<NetworkInterface>> GetAsync(string networkInterfaceName, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id.ResourceGroupName, networkInterfaceName, null, cancellationToken).ConfigureAwait(false);
return Response.FromValue(new NetworkInterface(Parent, new NetworkInterfaceData(response.Value)), response.GetRawResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ public AsyncPageable<GenericResource> ListAsGenericResourceAsync(string nameFilt
}

/// <inheritdoc />
public override Response<NetworkSecurityGroup> Get(string networkSecurityGroup, CancellationToken cancellationToken = default)
public Response<NetworkSecurityGroup> Get(string networkSecurityGroup, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id.ResourceGroupName, networkSecurityGroup, cancellationToken: cancellationToken);
return Response.FromValue(new NetworkSecurityGroup(Parent, new NetworkSecurityGroupData(response.Value)), response.GetRawResponse());
}

/// <inheritdoc/>
public override async Task<Response<NetworkSecurityGroup>> GetAsync(string networkSecurityGroup, CancellationToken cancellationToken = default)
public async Task<Response<NetworkSecurityGroup>> GetAsync(string networkSecurityGroup, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id.ResourceGroupName, networkSecurityGroup, null, cancellationToken);
return Response.FromValue(new NetworkSecurityGroup(Parent, new NetworkSecurityGroupData(response.Value)), response.GetRawResponse());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,14 @@ private Func<PublicIPAddress, PublicIpAddress> Convertor()
return s => new PublicIpAddress(Parent, new PublicIPAddressData(s));
}
/// <inheritdoc />
public override Response<PublicIpAddress> Get(string publicIpAddressesName, CancellationToken cancellationToken = default)
public Response<PublicIpAddress> Get(string publicIpAddressesName, CancellationToken cancellationToken = default)
{
var response = Operations.Get(Id.ResourceGroupName, publicIpAddressesName, cancellationToken: cancellationToken);
return Response.FromValue(new PublicIpAddress(Parent, new PublicIPAddressData(response.Value)), response.GetRawResponse());
}

/// <inheritdoc/>
public override async Task<Response<PublicIpAddress>> GetAsync(string publicIpAddressesName, CancellationToken cancellationToken = default)
public async Task<Response<PublicIpAddress>> GetAsync(string publicIpAddressesName, CancellationToken cancellationToken = default)
{
var response = await Operations.GetAsync(Id.ResourceGroupName, publicIpAddressesName, cancellationToken: cancellationToken).ConfigureAwait(false);
return Response.FromValue(new PublicIpAddress(Parent, new PublicIPAddressData(response.Value)), response.GetRawResponse());
Expand Down
Loading