public virtual Response <ArcExtensionResource> Get(string extensionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(extensionName, nameof(extensionName)); using var scope = _arcExtensionExtensionsClientDiagnostics.CreateScope("ArcExtensionCollection.Get"); scope.Start(); try { var response = _arcExtensionExtensionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, extensionName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ArcExtensionResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <ArcExtension> Get(CancellationToken cancellationToken = default) { using var scope = _arcExtensionExtensionsClientDiagnostics.CreateScope("ArcExtension.Get"); scope.Start(); try { var response = _arcExtensionExtensionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ArcExtension(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }