public virtual Response <NetworkVirtualApplianceSku> Get(CancellationToken cancellationToken = default) { using var scope = _networkVirtualApplianceSkuVirtualApplianceSkusClientDiagnostics.CreateScope("NetworkVirtualApplianceSku.Get"); scope.Start(); try { var response = _networkVirtualApplianceSkuVirtualApplianceSkusRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new NetworkVirtualApplianceSku(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <NetworkVirtualApplianceSku> Get(string skuName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(skuName, nameof(skuName)); using var scope = _networkVirtualApplianceSkuVirtualApplianceSkusClientDiagnostics.CreateScope("NetworkVirtualApplianceSkuCollection.Get"); scope.Start(); try { var response = _networkVirtualApplianceSkuVirtualApplianceSkusRestClient.Get(Id.SubscriptionId, skuName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new NetworkVirtualApplianceSku(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }