|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using Newtonsoft.Json; |
| 4 | +using Newtonsoft.Json.Converters; |
| 5 | +using Agoda.Graphql; |
| 6 | + |
| 7 | +namespace Agoda.Graphql.BookingQueries |
| 8 | +{ |
| 9 | + public class Query : QueryBase<Data> |
| 10 | + { |
| 11 | + private const string _query = @"query GetBookingDetailsByBookingId($bookingIds: [Int!]!) { |
| 12 | + BookingDetailsByBookingIds(bookingIds: $bookingIds) { |
| 13 | + propertyBooking { |
| 14 | + bookingId |
| 15 | + acknowledge { |
| 16 | + ackTypeId |
| 17 | + paymentModel |
| 18 | + } |
| 19 | + guests { |
| 20 | + guestNo |
| 21 | + firstName |
| 22 | + lastName |
| 23 | + nationalityName |
| 24 | + } |
| 25 | + summary { |
| 26 | + stayType |
| 27 | + } |
| 28 | + checkinDate |
| 29 | + checkoutDate |
| 30 | + bookingDate |
| 31 | + recCreatedWhen |
| 32 | + recModifiedWhen |
| 33 | + property { |
| 34 | + hotelId |
| 35 | + noOfRooms |
| 36 | + noOfAdults |
| 37 | + noOfChildren |
| 38 | + noOfExtraBeds |
| 39 | + bookingHotelRooms { |
| 40 | + roomTypeId |
| 41 | + } |
| 42 | + otherSpecialNeeds |
| 43 | + propertyDetails { |
| 44 | + country { |
| 45 | + countryId |
| 46 | + gmtOffset |
| 47 | + } |
| 48 | + } |
| 49 | + } |
| 50 | + benefits { |
| 51 | + benefitList: benefits { |
| 52 | + benefitId |
| 53 | + displayText |
| 54 | + } |
| 55 | + } |
| 56 | + memberId |
| 57 | + resellBooking { |
| 58 | + resellStatusId |
| 59 | + resellBookingId |
| 60 | + bookingId |
| 61 | + guestInfo { |
| 62 | + guests { |
| 63 | + firstName |
| 64 | + lastName |
| 65 | + } |
| 66 | + } |
| 67 | + } |
| 68 | + originalResellBooking { |
| 69 | + resellStatusId |
| 70 | + resellBookingId |
| 71 | + bookingId |
| 72 | + } |
| 73 | + resellBookingFeature { |
| 74 | + smartFlex { |
| 75 | + smartFlexBooking { |
| 76 | + smartFlexScenario |
| 77 | + liabilityStatus { |
| 78 | + replacedBookingId |
| 79 | + dateOfStay |
| 80 | + reason |
| 81 | + } |
| 82 | + } |
| 83 | + replacementBooking { |
| 84 | + smartFlexScenario |
| 85 | + originalSmartFlexBooking { |
| 86 | + bookingId |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + } |
| 91 | + enigmaAPI { |
| 92 | + contact { |
| 93 | + phoneNumber |
| 94 | + } |
| 95 | + } |
| 96 | + workflow { |
| 97 | + workflowStateId |
| 98 | + } |
| 99 | + dmc { |
| 100 | + dmcId |
| 101 | + } |
| 102 | + } |
| 103 | + } |
| 104 | +}"; |
| 105 | + |
| 106 | + public List<int> BookingIds { get; } |
| 107 | + |
| 108 | + public Query(List<int> bookingIds, IResultProcessor<Data> resultProcessor = null) : base(resultProcessor) |
| 109 | + { |
| 110 | + BookingIds = bookingIds; |
| 111 | + } |
| 112 | + |
| 113 | + protected override string QueryText => _query; |
| 114 | + |
| 115 | + protected override Dictionary<string, object> Variables => new Dictionary<string, object> |
| 116 | + { |
| 117 | + { "bookingIds", BookingIds } |
| 118 | + }; |
| 119 | + } |
| 120 | + |
| 121 | + public sealed class Data |
| 122 | + { |
| 123 | + [JsonProperty("BookingDetailsByBookingIds")] |
| 124 | + public List<BookingDetailsByBookingIds> BookingDetailsByBookingIds { get; set; } |
| 125 | + } |
| 126 | + |
| 127 | + public sealed class Acknowledge |
| 128 | + { |
| 129 | + [JsonProperty("ackTypeId")] |
| 130 | + public int AckTypeId { get; set; } |
| 131 | + [JsonProperty("paymentModel")] |
| 132 | + public int PaymentModel { get; set; } |
| 133 | + } |
| 134 | + |
| 135 | + public sealed class Guests |
| 136 | + { |
| 137 | + [JsonProperty("guestNo")] |
| 138 | + public int GuestNo { get; set; } |
| 139 | + [JsonProperty("firstName")] |
| 140 | + public string FirstName { get; set; } |
| 141 | + [JsonProperty("lastName")] |
| 142 | + public string LastName { get; set; } |
| 143 | + [JsonProperty("nationalityName")] |
| 144 | + public string NationalityName { get; set; } |
| 145 | + } |
| 146 | + |
| 147 | + public sealed class Summary |
| 148 | + { |
| 149 | + [JsonProperty("stayType")] |
| 150 | + public int? StayType { get; set; } |
| 151 | + } |
| 152 | + |
| 153 | + public sealed class BookingHotelRooms |
| 154 | + { |
| 155 | + [JsonProperty("roomTypeId")] |
| 156 | + public int? RoomTypeId { get; set; } |
| 157 | + } |
| 158 | + |
| 159 | + public sealed class Country |
| 160 | + { |
| 161 | + [JsonProperty("countryId")] |
| 162 | + public int CountryId { get; set; } |
| 163 | + [JsonProperty("gmtOffset")] |
| 164 | + public int? GmtOffset { get; set; } |
| 165 | + } |
| 166 | + |
| 167 | + public sealed class PropertyDetails |
| 168 | + { |
| 169 | + [JsonProperty("country")] |
| 170 | + public Country Country { get; set; } |
| 171 | + } |
| 172 | + |
| 173 | + public sealed class Property |
| 174 | + { |
| 175 | + [JsonProperty("hotelId")] |
| 176 | + public int HotelId { get; set; } |
| 177 | + [JsonProperty("noOfRooms")] |
| 178 | + public int NoOfRooms { get; set; } |
| 179 | + [JsonProperty("noOfAdults")] |
| 180 | + public int NoOfAdults { get; set; } |
| 181 | + [JsonProperty("noOfChildren")] |
| 182 | + public int NoOfChildren { get; set; } |
| 183 | + [JsonProperty("noOfExtraBeds")] |
| 184 | + public int? NoOfExtraBeds { get; set; } |
| 185 | + [JsonProperty("bookingHotelRooms")] |
| 186 | + public List<BookingHotelRooms> BookingHotelRooms { get; set; } |
| 187 | + [JsonProperty("otherSpecialNeeds")] |
| 188 | + public string OtherSpecialNeeds { get; set; } |
| 189 | + [JsonProperty("propertyDetails")] |
| 190 | + public PropertyDetails PropertyDetails { get; set; } |
| 191 | + } |
| 192 | + |
| 193 | + public sealed class BenefitList |
| 194 | + { |
| 195 | + [JsonProperty("benefitId")] |
| 196 | + public int BenefitId { get; set; } |
| 197 | + [JsonProperty("displayText")] |
| 198 | + public string DisplayText { get; set; } |
| 199 | + } |
| 200 | + |
| 201 | + public sealed class Benefits |
| 202 | + { |
| 203 | + [JsonProperty("benefits")] |
| 204 | + public List<BenefitList> BenefitList { get; set; } |
| 205 | + } |
| 206 | + |
| 207 | + public sealed class GuestInfoGuests |
| 208 | + { |
| 209 | + [JsonProperty("firstName")] |
| 210 | + public string FirstName { get; set; } |
| 211 | + [JsonProperty("lastName")] |
| 212 | + public string LastName { get; set; } |
| 213 | + } |
| 214 | + |
| 215 | + public sealed class GuestInfo |
| 216 | + { |
| 217 | + [JsonProperty("guests")] |
| 218 | + public List<GuestInfoGuests> Guests { get; set; } |
| 219 | + } |
| 220 | + |
| 221 | + public sealed class ResellBooking |
| 222 | + { |
| 223 | + [JsonProperty("resellStatusId")] |
| 224 | + public int ResellStatusId { get; set; } |
| 225 | + [JsonProperty("resellBookingId")] |
| 226 | + public int? ResellBookingId { get; set; } |
| 227 | + [JsonProperty("bookingId")] |
| 228 | + public int BookingId { get; set; } |
| 229 | + [JsonProperty("guestInfo")] |
| 230 | + public GuestInfo GuestInfo { get; set; } |
| 231 | + } |
| 232 | + |
| 233 | + public sealed class OriginalResellBooking |
| 234 | + { |
| 235 | + [JsonProperty("resellStatusId")] |
| 236 | + public int ResellStatusId { get; set; } |
| 237 | + [JsonProperty("resellBookingId")] |
| 238 | + public int? ResellBookingId { get; set; } |
| 239 | + [JsonProperty("bookingId")] |
| 240 | + public int BookingId { get; set; } |
| 241 | + } |
| 242 | + |
| 243 | + public sealed class LiabilityStatus |
| 244 | + { |
| 245 | + [JsonProperty("replacedBookingId")] |
| 246 | + public int? ReplacedBookingId { get; set; } |
| 247 | + [JsonProperty("dateOfStay")] |
| 248 | + public string DateOfStay { get; set; } |
| 249 | + [JsonProperty("reason")] |
| 250 | + public int? Reason { get; set; } |
| 251 | + } |
| 252 | + |
| 253 | + public sealed class SmartFlexBooking |
| 254 | + { |
| 255 | + [JsonProperty("smartFlexScenario")] |
| 256 | + public int? SmartFlexScenario { get; set; } |
| 257 | + [JsonProperty("liabilityStatus")] |
| 258 | + public List<LiabilityStatus> LiabilityStatus { get; set; } |
| 259 | + } |
| 260 | + |
| 261 | + public sealed class OriginalSmartFlexBooking |
| 262 | + { |
| 263 | + [JsonProperty("bookingId")] |
| 264 | + public int BookingId { get; set; } |
| 265 | + } |
| 266 | + |
| 267 | + public sealed class ReplacementBooking |
| 268 | + { |
| 269 | + [JsonProperty("smartFlexScenario")] |
| 270 | + public int? SmartFlexScenario { get; set; } |
| 271 | + [JsonProperty("originalSmartFlexBooking")] |
| 272 | + public List<OriginalSmartFlexBooking> OriginalSmartFlexBooking { get; set; } |
| 273 | + } |
| 274 | + |
| 275 | + public sealed class SmartFlex |
| 276 | + { |
| 277 | + [JsonProperty("smartFlexBooking")] |
| 278 | + public SmartFlexBooking SmartFlexBooking { get; set; } |
| 279 | + [JsonProperty("replacementBooking")] |
| 280 | + public ReplacementBooking ReplacementBooking { get; set; } |
| 281 | + } |
| 282 | + |
| 283 | + public sealed class ResellBookingFeature |
| 284 | + { |
| 285 | + [JsonProperty("smartFlex")] |
| 286 | + public SmartFlex SmartFlex { get; set; } |
| 287 | + } |
| 288 | + |
| 289 | + public sealed class Contact |
| 290 | + { |
| 291 | + [JsonProperty("phoneNumber")] |
| 292 | + public string PhoneNumber { get; set; } |
| 293 | + } |
| 294 | + |
| 295 | + public sealed class EnigmaAPI |
| 296 | + { |
| 297 | + [JsonProperty("contact")] |
| 298 | + public Contact Contact { get; set; } |
| 299 | + } |
| 300 | + |
| 301 | + public sealed class Workflow |
| 302 | + { |
| 303 | + [JsonProperty("workflowStateId")] |
| 304 | + public int? WorkflowStateId { get; set; } |
| 305 | + } |
| 306 | + |
| 307 | + public sealed class Dmc |
| 308 | + { |
| 309 | + [JsonProperty("dmcId")] |
| 310 | + public int? DmcId { get; set; } |
| 311 | + } |
| 312 | + |
| 313 | + public sealed class PropertyBooking |
| 314 | + { |
| 315 | + [JsonProperty("bookingId")] |
| 316 | + public int BookingId { get; set; } |
| 317 | + [JsonProperty("acknowledge")] |
| 318 | + public Acknowledge Acknowledge { get; set; } |
| 319 | + [JsonProperty("guests")] |
| 320 | + public List<Guests> Guests { get; set; } |
| 321 | + [JsonProperty("summary")] |
| 322 | + public Summary Summary { get; set; } |
| 323 | + [JsonProperty("checkinDate")] |
| 324 | + public DateTime? CheckinDate { get; set; } |
| 325 | + [JsonProperty("checkoutDate")] |
| 326 | + public DateTime? CheckoutDate { get; set; } |
| 327 | + [JsonProperty("bookingDate")] |
| 328 | + public DateTime? BookingDate { get; set; } |
| 329 | + [JsonProperty("recCreatedWhen")] |
| 330 | + public DateTime? RecCreatedWhen { get; set; } |
| 331 | + [JsonProperty("recModifiedWhen")] |
| 332 | + public DateTime? RecModifiedWhen { get; set; } |
| 333 | + [JsonProperty("property")] |
| 334 | + public Property Property { get; set; } |
| 335 | + [JsonProperty("benefits")] |
| 336 | + public Benefits Benefits { get; set; } |
| 337 | + [JsonProperty("memberId")] |
| 338 | + public int? MemberId { get; set; } |
| 339 | + [JsonProperty("resellBooking")] |
| 340 | + public ResellBooking ResellBooking { get; set; } |
| 341 | + [JsonProperty("originalResellBooking")] |
| 342 | + public OriginalResellBooking OriginalResellBooking { get; set; } |
| 343 | + [JsonProperty("resellBookingFeature")] |
| 344 | + public ResellBookingFeature ResellBookingFeature { get; set; } |
| 345 | + [JsonProperty("enigmaAPI")] |
| 346 | + public EnigmaAPI EnigmaAPI { get; set; } |
| 347 | + [JsonProperty("workflow")] |
| 348 | + public Workflow Workflow { get; set; } |
| 349 | + [JsonProperty("dmc")] |
| 350 | + public Dmc Dmc { get; set; } |
| 351 | + } |
| 352 | + |
| 353 | + public sealed class BookingDetailsByBookingIds |
| 354 | + { |
| 355 | + [JsonProperty("propertyBooking")] |
| 356 | + public PropertyBooking PropertyBooking { get; set; } |
| 357 | + } |
| 358 | + |
| 359 | +} |
0 commit comments