Add org registry export

This commit is contained in:
2025-08-25 20:40:10 +09:00
parent 039424eb9c
commit 0677cdb42e
30 changed files with 8064 additions and 0 deletions

View 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 [];
}
}
}
}