public async virtual Task <Response <VirtualHubRouteTableV2> > GetAsync(string routeTableName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualHubRouteTableV2Container.Get"); scope.Start(); try { if (routeTableName == null) { throw new ArgumentNullException(nameof(routeTableName)); } var response = await _restClient.GetAsync(Id.ResourceGroupName, Id.Name, routeTableName, cancellationToken : cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new VirtualHubRouteTableV2(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <VirtualHubRouteTableV2Resource> > GetAsync(string routeTableName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(routeTableName, nameof(routeTableName)); using var scope = _virtualHubRouteTableV2ClientDiagnostics.CreateScope("VirtualHubRouteTableV2Collection.Get"); scope.Start(); try { var response = await _virtualHubRouteTableV2RestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, routeTableName, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new VirtualHubRouteTableV2Resource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public async virtual Task <Response <VirtualHubRouteTableV2> > GetAsync(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VirtualHubRouteTableV2.Get"); scope.Start(); try { var response = await _virtualHubRouteTableV2sRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new VirtualHubRouteTableV2(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }