45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using Hcs.Broker.Api.Request.Exception;
|
|
using Hcs.Broker.Api.Request.NsiCommon;
|
|
using Hcs.Service.Async.NsiCommon;
|
|
|
|
namespace Hcs.Broker.Api
|
|
{
|
|
/// <inheritdoc cref="INsiCommonApi"/>
|
|
public class NsiCommonApi(Client client) : ApiBase(client), INsiCommonApi
|
|
{
|
|
/// <inheritdoc cref="INsiCommonApi"/>
|
|
public async Task<NsiItemType> ExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default)
|
|
{
|
|
try
|
|
{
|
|
var request = new ExportNsiItemRequest(client);
|
|
return await request.ExecuteAsync(registryNumber, listGroup, token);
|
|
}
|
|
catch (NoResultsRemoteException)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// <inheritdoc cref="INsiCommonApi"/>
|
|
public async Task<NsiListType> ExportNsiListAsync(ListGroup listGroup, CancellationToken token = default)
|
|
{
|
|
try
|
|
{
|
|
var request = new ExportNsiListRequest(client);
|
|
return await request.ExecuteAsync(listGroup, token);
|
|
}
|
|
catch (NoResultsRemoteException)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// <inheritdoc cref="INsiCommonApi"/>
|
|
public Task<string> RequestExportNsiItemAsync(int registryNumber, ListGroup listGroup, CancellationToken token = default)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|