|
4 | 4 | using Newtonsoft.Json.Converters;
|
5 | 5 | using Agoda.Graphql;
|
6 | 6 |
|
7 |
| - |
8 |
| - |
9 |
| - |
10 |
| -#region GetBookingListByBookingIds |
11 |
| - |
12 |
| -namespace Agoda.Graphql.BookingQueries.PropertyBooking.GetBookingListByBookingIds |
| 7 | +namespace Agoda.Graphql.BookingQueries.PropertyBooking |
13 | 8 | {
|
14 |
| - |
15 |
| - /// <summary>Operation Type</summary> |
16 |
| - public partial class Query : QueryBase<Data> |
17 |
| - { |
| 9 | + public class Query : QueryBase<Data> |
| 10 | + { |
18 | 11 | private const string _query = @"query GetBookingListByBookingIds($bookingIds: [Int!]!) {
|
19 | 12 | BookingDetailsByBookingIds(bookingIds: $bookingIds) {
|
20 | 13 | baseBooking {
|
@@ -70,249 +63,159 @@ public partial class Query : QueryBase<Data>
|
70 | 63 | }
|
71 | 64 | }";
|
72 | 65 |
|
| 66 | + public List<int> BookingIds { get; } |
| 67 | + |
73 | 68 | public Query(List<int> bookingIds, IResultProcessor<Data> resultProcessor = null) : base(resultProcessor)
|
74 | 69 | {
|
75 | 70 | BookingIds = bookingIds;
|
76 | 71 | }
|
77 | 72 |
|
78 |
| - public List<int> BookingIds { get; } |
79 | 73 | protected override string QueryText => _query;
|
80 | 74 |
|
81 | 75 | protected override Dictionary<string, object> Variables => new Dictionary<string, object>
|
82 | 76 | {
|
83 |
| - { "bookingIds", BookingIds }, |
84 |
| - }; |
| 77 | + { "bookingIds", BookingIds } |
| 78 | + }; |
85 | 79 | }
|
86 | 80 |
|
87 | 81 | public sealed class Data
|
88 |
| - { |
89 |
| - |
90 |
| - |
| 82 | + { |
91 | 83 | [JsonProperty("BookingDetailsByBookingIds")]
|
92 |
| - public List<BookingDetailsByBookingIds> BookingDetailsByBookingIds { get; set; } |
| 84 | + public List<CrossProductBookingMeta> BookingDetailsByBookingIds { get; set; } |
93 | 85 | }
|
94 |
| - |
95 | 86 |
|
96 |
| - /// <summary>Inner Model</summary> |
97 |
| - public sealed class BookingDetailsByBookingIds |
| 87 | + public sealed class BaseBookingInfo |
98 | 88 | {
|
99 |
| - |
100 |
| - |
101 |
| - [JsonProperty("baseBooking")] |
102 |
| - public BaseBooking BaseBooking { get; set; } |
103 |
| - |
104 |
| - |
105 |
| - [JsonProperty("propertyBooking")] |
106 |
| - public PropertyBooking PropertyBooking { get; set; } |
107 |
| - } |
108 |
| - |
109 |
| - /// <summary>Inner Model</summary> |
110 |
| - public sealed class BaseBooking |
111 |
| - { |
112 |
| - |
113 |
| - |
114 | 89 | [JsonProperty("bookingId")]
|
115 | 90 | public long BookingId { get; set; }
|
116 | 91 | }
|
117 | 92 |
|
118 |
| - /// <summary>Inner Model</summary> |
119 |
| - public sealed class PropertyBooking |
120 |
| - { |
121 |
| - |
122 |
| - |
123 |
| - [JsonProperty("checkinDate")] |
124 |
| - public LocalDateTime? CheckinDate { get; set; } |
125 |
| - |
126 |
| - |
127 |
| - [JsonProperty("checkoutDate")] |
128 |
| - public LocalDateTime? CheckoutDate { get; set; } |
129 |
| - |
130 |
| - |
131 |
| - [JsonProperty("bookingHotelRooms")] |
132 |
| - public List<BookingHotelRooms> BookingHotelRooms { get; set; } |
133 |
| - |
134 |
| - |
135 |
| - [JsonProperty("paymentModel")] |
136 |
| - public int? PaymentModel { get; set; } |
137 |
| - |
138 |
| - |
139 |
| - [JsonProperty("guests")] |
140 |
| - public List<Guests> Guests { get; set; } |
141 |
| - |
142 |
| - |
143 |
| - [JsonProperty("property")] |
144 |
| - public Property Property { get; set; } |
145 |
| - |
146 |
| - |
147 |
| - [JsonProperty("dmc")] |
148 |
| - public Dmc Dmc { get; set; } |
149 |
| - |
150 |
| - |
151 |
| - [JsonProperty("resellBookingFeature")] |
152 |
| - public ResellBookingFeature ResellBookingFeature { get; set; } |
153 |
| - |
154 |
| - |
155 |
| - [JsonProperty("acknowledge")] |
156 |
| - public Acknowledge Acknowledge { get; set; } |
157 |
| - |
158 |
| - |
159 |
| - [JsonProperty("occupancy")] |
160 |
| - public Occupancy Occupancy { get; set; } |
161 |
| - |
162 |
| - |
163 |
| - [JsonProperty("resellBooking")] |
164 |
| - public ResellBooking ResellBooking { get; set; } |
165 |
| - } |
166 |
| - |
167 |
| - /// <summary>Inner Model</summary> |
168 |
| - public sealed class BookingHotelRooms |
| 93 | + public sealed class PropertyRoom |
169 | 94 | {
|
170 |
| - |
171 |
| - |
172 | 95 | [JsonProperty("roomTypeId")]
|
173 | 96 | public int? RoomTypeId { get; set; }
|
174 | 97 | }
|
175 | 98 |
|
176 |
| - /// <summary>Inner Model</summary> |
177 |
| - public sealed class Guests |
| 99 | + public sealed class PropertyGuest |
178 | 100 | {
|
179 |
| - |
180 |
| - |
181 | 101 | [JsonProperty("firstName")]
|
182 | 102 | public string FirstName { get; set; }
|
183 |
| - |
184 |
| - |
185 | 103 | [JsonProperty("lastName")]
|
186 | 104 | public string LastName { get; set; }
|
187 |
| - |
188 |
| - |
189 | 105 | [JsonProperty("guestNo")]
|
190 | 106 | public int GuestNo { get; set; }
|
191 | 107 | }
|
192 | 108 |
|
193 |
| - /// <summary>Inner Model</summary> |
194 |
| - public sealed class Property |
| 109 | + public sealed class PropertyInfo |
195 | 110 | {
|
196 |
| - |
197 |
| - |
198 | 111 | [JsonProperty("hotelId")]
|
199 | 112 | public int HotelId { get; set; }
|
200 | 113 | }
|
201 | 114 |
|
202 |
| - /// <summary>Inner Model</summary> |
203 |
| - public sealed class Dmc |
| 115 | + public sealed class PropertyDmc |
204 | 116 | {
|
205 |
| - |
206 |
| - |
207 | 117 | [JsonProperty("dmcId")]
|
208 | 118 | public int? DmcId { get; set; }
|
209 | 119 | }
|
210 | 120 |
|
211 |
| - /// <summary>Inner Model</summary> |
212 |
| - public sealed class ResellBookingFeature |
| 121 | + public sealed class SmartFlexBookingQueryInput |
213 | 122 | {
|
214 |
| - |
215 |
| - |
216 |
| - [JsonProperty("smartFlex")] |
217 |
| - public SmartFlex SmartFlex { get; set; } |
| 123 | + [JsonProperty("smartFlexScenario")] |
| 124 | + public int? SmartFlexScenario { get; set; } |
218 | 125 | }
|
219 | 126 |
|
220 |
| - /// <summary>Inner Model</summary> |
221 |
| - public sealed class SmartFlex |
| 127 | + public sealed class ReplacementBooking |
222 | 128 | {
|
223 |
| - |
224 |
| - |
225 |
| - [JsonProperty("smartFlexBooking")] |
226 |
| - public SmartFlexBooking SmartFlexBooking { get; set; } |
227 |
| - |
228 |
| - |
229 |
| - [JsonProperty("replacementBooking")] |
230 |
| - public ReplacementBooking ReplacementBooking { get; set; } |
| 129 | + [JsonProperty("smartFlexScenario")] |
| 130 | + public int? SmartFlexScenario { get; set; } |
231 | 131 | }
|
232 | 132 |
|
233 |
| - /// <summary>Inner Model</summary> |
234 |
| - public sealed class SmartFlexBooking |
| 133 | + public sealed class SmartFlexQueryInput |
235 | 134 | {
|
236 |
| - |
237 |
| - |
238 |
| - [JsonProperty("smartFlexScenario")] |
239 |
| - public int? SmartFlexScenario { get; set; } |
| 135 | + [JsonProperty("smartFlexBooking")] |
| 136 | + public SmartFlexBookingQueryInput SmartFlexBooking { get; set; } |
| 137 | + [JsonProperty("replacementBooking")] |
| 138 | + public ReplacementBooking ReplacementBooking { get; set; } |
240 | 139 | }
|
241 | 140 |
|
242 |
| - /// <summary>Inner Model</summary> |
243 |
| - public sealed class ReplacementBooking |
| 141 | + public sealed class ResellBookingFeatureQueryInput |
244 | 142 | {
|
245 |
| - |
246 |
| - |
247 |
| - [JsonProperty("smartFlexScenario")] |
248 |
| - public int? SmartFlexScenario { get; set; } |
| 143 | + [JsonProperty("smartFlex")] |
| 144 | + public SmartFlexQueryInput SmartFlex { get; set; } |
249 | 145 | }
|
250 | 146 |
|
251 |
| - /// <summary>Inner Model</summary> |
252 |
| - public sealed class Acknowledge |
| 147 | + public sealed class PropertyBookingAcknowledge |
253 | 148 | {
|
254 |
| - |
255 |
| - |
256 | 149 | [JsonProperty("ackTypeId")]
|
257 | 150 | public int AckTypeId { get; set; }
|
258 | 151 | }
|
259 | 152 |
|
260 |
| - /// <summary>Inner Model</summary> |
261 |
| - public sealed class Occupancy |
| 153 | + public sealed class OccupancyInfo |
262 | 154 | {
|
263 |
| - |
264 |
| - |
265 | 155 | [JsonProperty("numberOfAdults")]
|
266 | 156 | public int NumberOfAdults { get; set; }
|
267 |
| - |
268 |
| - |
269 | 157 | [JsonProperty("numberOfChildren")]
|
270 | 158 | public int NumberOfChildren { get; set; }
|
271 | 159 | }
|
272 | 160 |
|
273 |
| - /// <summary>Inner Model</summary> |
274 |
| - public sealed class ResellBooking |
| 161 | + public sealed class BookingGuest |
| 162 | + { |
| 163 | + [JsonProperty("firstName")] |
| 164 | + public string FirstName { get; set; } |
| 165 | + [JsonProperty("lastName")] |
| 166 | + public string LastName { get; set; } |
| 167 | + } |
| 168 | + |
| 169 | + public sealed class EnigmaGuestInfo |
| 170 | + { |
| 171 | + [JsonProperty("guests")] |
| 172 | + public List<BookingGuest> Guests { get; set; } |
| 173 | + } |
| 174 | + |
| 175 | + public sealed class ResellBookingDetails |
275 | 176 | {
|
276 |
| - |
277 |
| - |
278 | 177 | [JsonProperty("resellBookingId")]
|
279 | 178 | public int? ResellBookingId { get; set; }
|
280 |
| - |
281 |
| - |
282 | 179 | [JsonProperty("resellStatusId")]
|
283 | 180 | public int ResellStatusId { get; set; }
|
284 |
| - |
285 |
| - |
286 | 181 | [JsonProperty("resellTypeId")]
|
287 | 182 | public int? ResellTypeId { get; set; }
|
288 |
| - |
289 |
| - |
290 | 183 | [JsonProperty("guestInfo")]
|
291 |
| - public GuestInfo GuestInfo { get; set; } |
| 184 | + public EnigmaGuestInfo GuestInfo { get; set; } |
292 | 185 | }
|
293 | 186 |
|
294 |
| - /// <summary>Inner Model</summary> |
295 |
| - public sealed class GuestInfo |
| 187 | + public sealed class PropertyBooking |
296 | 188 | {
|
297 |
| - |
298 |
| - |
| 189 | + [JsonProperty("checkinDate")] |
| 190 | + public DateTime? CheckinDate { get; set; } |
| 191 | + [JsonProperty("checkoutDate")] |
| 192 | + public DateTime? CheckoutDate { get; set; } |
| 193 | + [JsonProperty("bookingHotelRooms")] |
| 194 | + public List<PropertyRoom> BookingHotelRooms { get; set; } |
| 195 | + [JsonProperty("paymentModel")] |
| 196 | + public int? PaymentModel { get; set; } |
299 | 197 | [JsonProperty("guests")]
|
300 |
| - public List<_Guests> Guests { get; set; } |
| 198 | + public List<PropertyGuest> Guests { get; set; } |
| 199 | + [JsonProperty("property")] |
| 200 | + public PropertyInfo Property { get; set; } |
| 201 | + [JsonProperty("dmc")] |
| 202 | + public PropertyDmc Dmc { get; set; } |
| 203 | + [JsonProperty("resellBookingFeature")] |
| 204 | + public ResellBookingFeatureQueryInput ResellBookingFeature { get; set; } |
| 205 | + [JsonProperty("acknowledge")] |
| 206 | + public PropertyBookingAcknowledge Acknowledge { get; set; } |
| 207 | + [JsonProperty("occupancy")] |
| 208 | + public OccupancyInfo Occupancy { get; set; } |
| 209 | + [JsonProperty("resellBooking")] |
| 210 | + public ResellBookingDetails ResellBooking { get; set; } |
301 | 211 | }
|
302 | 212 |
|
303 |
| - /// <summary>Inner Model</summary> |
304 |
| - public sealed class _Guests |
| 213 | + public sealed class CrossProductBookingMeta |
305 | 214 | {
|
306 |
| - |
307 |
| - |
308 |
| - [JsonProperty("firstName")] |
309 |
| - public string FirstName { get; set; } |
310 |
| - |
311 |
| - |
312 |
| - [JsonProperty("lastName")] |
313 |
| - public string LastName { get; set; } |
| 215 | + [JsonProperty("baseBooking")] |
| 216 | + public BaseBookingInfo BaseBooking { get; set; } |
| 217 | + [JsonProperty("propertyBooking")] |
| 218 | + public PropertyBooking PropertyBooking { get; set; } |
314 | 219 | }
|
315 |
| -} |
316 |
| - |
317 |
| -#endregion |
318 | 220 |
|
| 221 | +} |
0 commit comments