Files
hcs/Hcs.Client/Client/Api/Request/Bills/ExportPaymentDocumentDataRequest.cs

34 lines
1.3 KiB
C#

using Hcs.Client.Internal;
using Hcs.Service.Async.Bills;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Hcs.Client.Api.Request.Bills
{
internal class ExportPaymentDocumentDataRequest(ClientBase client) : BillsRequestBase(client)
{
protected override bool CanBeRestarted => true;
internal async Task<IEnumerable<exportPaymentDocumentResultType>> ExecuteAsync(short year, int month, string fiasHouseGuid, string accountGUID, CancellationToken token)
{
var request = new exportPaymentDocumentRequest()
{
Id = Constants.SIGNED_XML_ELEMENT_ID,
version = "13.1.0.1",
Items = [year, month, fiasHouseGuid, accountGUID],
ItemsElementName = [ItemsChoiceType7.Year, ItemsChoiceType7.Month, ItemsChoiceType7.FIASHouseGuid, ItemsChoiceType7.AccountGUID]
};
var result = await SendAndWaitResultAsync(request, async asyncClient =>
{
var response = await asyncClient.exportPaymentDocumentDataAsync(CreateRequestHeader(), request);
return response.AckRequest.Ack;
}, token);
return result.Items.OfType<exportPaymentDocumentResultType>();
}
}
}