Add org registry export
This commit is contained in:
33
Hcs.Client/Client/Api/OrgRegistryCommonApi.cs
Normal file
33
Hcs.Client/Client/Api/OrgRegistryCommonApi.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Hcs.Client.Api.Request.Exception;
|
||||
using Hcs.Client.Api.Request.OrgRegistryCommon;
|
||||
using Hcs.Service.Async.OrgRegistryCommon;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Hcs.Client.Api
|
||||
{
|
||||
// http://open-gkh.ru/OrganizationsRegistryCommonAsyncService/
|
||||
public class OrgRegistryCommonApi(ClientBase client) : ApiBase(client)
|
||||
{
|
||||
/// <summary>
|
||||
/// Возвращает сведения из реестра организаций
|
||||
/// </summary>
|
||||
/// <param name="ogrn">ОГРН</param>
|
||||
/// <param name="kpp">КПП</param>
|
||||
/// <param name="token">Токен отмены</param>
|
||||
/// <returns>Сведения из реестра организаций</returns>
|
||||
public async Task<IEnumerable<exportOrgRegistryResultType>> ExportOrgRegistryAsync(string ogrn, string kpp, CancellationToken token = default)
|
||||
{
|
||||
try
|
||||
{
|
||||
var request = new ExportOrgRegistryRequest(client);
|
||||
return await request.ExecuteAsync(ogrn, kpp, token);
|
||||
}
|
||||
catch (NoResultsRemoteException)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user