Add house export

This commit is contained in:
2025-09-05 12:04:28 +09:00
parent b6241c74b0
commit 5df0a2ea43
5 changed files with 55 additions and 1 deletions

View File

@ -0,0 +1,33 @@
using Hcs.Client.Internal;
using Hcs.Service.Async.HouseManagement;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Hcs.Client.Api.Request.HouseManagement
{
internal class ExportHouseRequest(ClientBase client) : HouseManagementRequestBase(client)
{
protected override bool EnableMinimalResponseWaitDelay => false;
internal async Task<IEnumerable<exportHouseResultType>> ExecuteAsync(string fiasHouseGuid, CancellationToken token)
{
// http://open-gkh.ru/HouseManagement/exportHouseRequest.html
var request = new exportHouseRequest
{
Id = Constants.SIGNED_XML_ELEMENT_ID,
version = "15.6.0.1",
FIASHouseGuid = fiasHouseGuid
};
var result = await SendAndWaitResultAsync(request, async asyncClient =>
{
var response = await asyncClient.exportHouseDataAsync(CreateRequestHeader(), request);
return response.AckRequest.Ack;
}, token);
return result.Items.OfType<exportHouseResultType>();
}
}
}