public virtual Response <CdnOriginGroup> Get(string originGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(originGroupName, nameof(originGroupName)); using var scope = _cdnOriginGroupClientDiagnostics.CreateScope("CdnOriginGroupCollection.Get"); scope.Start(); try { var response = _cdnOriginGroupRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, originGroupName, cancellationToken); if (response.Value == null) { throw _cdnOriginGroupClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new CdnOriginGroup(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <CdnOriginGroup> Get(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("CdnOriginGroup.Get"); scope.Start(); try { var response = _cdnOriginGroupsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new CdnOriginGroup(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }