public virtual Response <AzureWebCategory> Get(string name, string expand = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); using var scope = _azureWebCategoryWebCategoriesClientDiagnostics.CreateScope("AzureWebCategoryCollection.Get"); scope.Start(); try { var response = _azureWebCategoryWebCategoriesRestClient.Get(Id.SubscriptionId, name, expand, cancellationToken); if (response.Value == null) { throw _azureWebCategoryWebCategoriesClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new AzureWebCategory(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <AzureWebCategoryResource> Get(string expand = null, CancellationToken cancellationToken = default) { using var scope = _azureWebCategoryWebCategoriesClientDiagnostics.CreateScope("AzureWebCategoryResource.Get"); scope.Start(); try { var response = _azureWebCategoryWebCategoriesRestClient.Get(Id.SubscriptionId, Id.Name, expand, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new AzureWebCategoryResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }