public async Task <bool> Ping()
        {
            try
            {
                await _client.Get("ping");
            }
            catch (RestHttpClientException)
            {
                return(false);
            }

            return(true);
        }
        public async Task <BlockedOrganisationStatus> GetProviderBlockedStatusAsync(long providerUkprn, CancellationToken cancellationToken = default)
        {
            var blockedProviderStatusUri = $"/api/providers/{providerUkprn}/status";

            try
            {
                var blockedOrgStatus = await _httpClient.Get <BlockedOrganisationStatus>(blockedProviderStatusUri, cancellationToken);

                return(blockedOrgStatus);
            }
            catch (Exception ex)
            {
                _log.Warn($"Failed to call Provider Blocked Status endpoint of Recruit API: {ex.Message}");
                throw;
            }
        }
예제 #3
0
        public async Task <bool> IsEmailAddressInUse(string emailAddress, CancellationToken cancellationToken = default)
        {
            var employerUserEmailQueryUri = $"/api/user?email={emailAddress}";

            try
            {
                var user = await _httpClient.Get <UserDto>(employerUserEmailQueryUri, null, cancellationToken);

                return(user != null);
            }
            catch (Exception)
            {
                return(false);
            }
        }
예제 #4
0
        public async Task <InvitationDto> GetInvitationById(Guid correlationId, CancellationToken cancellationToken = default)
        {
            var invitationQueryUri = $"/api/invitations/{correlationId}";

            try
            {
                var invitation = await _httpClient.Get <InvitationDto>(invitationQueryUri, cancellationToken);

                return(invitation);
            }
            catch (Exception ex)
            {
                _log.Warn($"Failed to call invitations endpoint of Registration API: {ex.Message}");
                throw;
            }
        }
예제 #5
0
        public async Task <Provider> GetProvider(long ukprn)
        {
            var employerUserEmailQueryUri = $"/api/v1/Search?SearchTerm={ukprn}";

            var providerResult = await _client.Get <RoatpProviderResult>(employerUserEmailQueryUri);

            var provider = providerResult.SearchResults.FirstOrDefault();

            if (provider == null)
            {
                return(null);
            }

            return(new Provider
            {
                Name = provider.Name,
                Ukprn = provider.Ukprn
            });
        }
예제 #6
0
 public async Task <GetPledgeApplicationResponse> GetPledgeApplication(int pledgeApplicationId, CancellationToken cancellationToken = default)
 {
     return(await _client.Get <GetPledgeApplicationResponse>($"PledgeApplications/{pledgeApplicationId}", null, cancellationToken));
 }
 /// <summary>
 /// Gets the bitcoin real data.
 /// </summary>
 /// <returns>Bitcoin Real Time Data</returns>
 public async Task <BitcoinRealTimeData> GetBitcoinRealData()
 {
     return(await restHttpClient.Get <BitcoinRealTimeData>
                ("https://www.bitstamp.net/api/", "ticker/"));
 }
 public Task <T> GetAsync <T>(string url, object data, CancellationToken token)
 {
     return(_client.Get <T>(url, data, token));
 }
예제 #9
0
 public Task Ping()
 {
     return(_client.Get("api/ping"));
 }
 public Task <User> GetUser(string userRef, CancellationToken cancellationToken)
 {
     return(_httpClient.Get <User>($"api/user/{userRef}", null, cancellationToken));
 }
 public Task Ping()
 {
     return(_restHttpClient.Get("ping"));
 }
 public async Task <GetAccountProviderLegalEntitiesWithPermissionResponse> GetAccountProviderLegalEntitiesWithPermission(GetAccountProviderLegalEntitiesWithPermissionRequest withPermissionRequest, CancellationToken cancellationToken = default)
 {
     return(await _restHttpClient.Get <GetAccountProviderLegalEntitiesWithPermissionResponse>("accountproviderlegalentities", withPermissionRequest, cancellationToken));
 }