hotelsGetCatalogFiles method
Get hotel catalog files
Returns download links for the current hotel catalog files. Returns { generatedAt, hotelCount, files: [{ variant, url, sizeBytes }] }, one zip per variant. Each zip holds hotels.jsonl: one hotel per line, in the item shape that search and properties/{id} return, with offers empty. withoutImages carries each hotel's main image as logoUrl and an empty details.imageUrls; withImages also lists every gallery image there. generatedAt is null and files empty before the first catalog is built, and after a release that changes the line format until the first build in the new format: the route never links a file whose lines have another format. The route takes no query parameters.
Implementation
Future<HotelCatalogExport?> hotelsGetCatalogFiles({ Future<void>? abortTrigger, }) async {
final response = await hotelsGetCatalogFilesWithHttpInfo(abortTrigger: abortTrigger,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'HotelCatalogExport',) as HotelCatalogExport;
}
return null;
}