Example #1
0
        public virtual Response <Provider> Get(CancellationToken cancellationToken = default)
        {
            using var scope = _clientDiagnostics.CreateScope("Provider.Get");
            scope.Start();

            try
            {
                var result = _restClient.Get(Id.Name, null, cancellationToken);
                if (result.Value == null)
                {
                    throw _clientDiagnostics.CreateRequestFailedException(result.GetRawResponse());
                }

                return(Response.FromValue(new Provider(this, result), result.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }