public virtual Response <AfdCustomDomain> Get(string customDomainName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(customDomainName, nameof(customDomainName)); using var scope = _afdCustomDomainClientDiagnostics.CreateScope("AfdCustomDomainCollection.Get"); scope.Start(); try { var response = _afdCustomDomainRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, customDomainName, cancellationToken); if (response.Value == null) { throw _afdCustomDomainClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new AfdCustomDomain(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <AfdCustomDomainResource> Get(CancellationToken cancellationToken = default) { using var scope = _afdCustomDomainClientDiagnostics.CreateScope("AfdCustomDomainResource.Get"); scope.Start(); try { var response = _afdCustomDomainRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new AfdCustomDomainResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }