public virtual Response <DataPolicyManifest> Get(string policyMode, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(policyMode, nameof(policyMode)); using var scope = _dataPolicyManifestClientDiagnostics.CreateScope("DataPolicyManifestCollection.Get"); scope.Start(); try { var response = _dataPolicyManifestRestClient.GetByPolicyMode(policyMode, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new DataPolicyManifest(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <DataPolicyManifest> Get(CancellationToken cancellationToken = default) { using var scope = _dataPolicyManifestClientDiagnostics.CreateScope("DataPolicyManifest.Get"); scope.Start(); try { var response = _dataPolicyManifestRestClient.GetByPolicyMode(Id.Name, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new DataPolicyManifest(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }