|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using Newtonsoft.Json; |
| 4 | +using Newtonsoft.Json.Converters; |
| 5 | +using Newtonsoft.Json.Linq; |
| 6 | +using Agoda.Graphql; |
| 7 | + |
| 8 | +namespace Agoda.Graphql.SupplyApi.Queries.Promotion.GetHotelPromotionSuggestionSettingByCity |
| 9 | +{ |
| 10 | + public class Query : QueryBase<Data> |
| 11 | + { |
| 12 | + private const string _query = @"query GetHotelPromotionSuggestionSettingByCity($cityId: Int!) { |
| 13 | + PromotionSuggestionSettingsByCityPromotionType(cityId: $cityId) { |
| 14 | + id |
| 15 | + cityId |
| 16 | + promotionTypeId |
| 17 | + startDate |
| 18 | + endDate |
| 19 | + startMonth |
| 20 | + endMonth |
| 21 | + discountValue |
| 22 | + promotionDiscountTypeId |
| 23 | + minAdvPurchase |
| 24 | + maxAdvPurchase |
| 25 | + stayOn |
| 26 | + minNightsStay |
| 27 | + bookTimeFrom |
| 28 | + bookTimeTo |
| 29 | + isActive |
| 30 | + lastUpdatedBy |
| 31 | + lastUpdatedWhen |
| 32 | + PromotionSuggestion { |
| 33 | + cityId |
| 34 | + promotionTypeId |
| 35 | + rank |
| 36 | + lastUpdatedBy |
| 37 | + lastUpdatedWhen |
| 38 | + } |
| 39 | + } |
| 40 | +}"; |
| 41 | + |
| 42 | + public int CityId { get; } |
| 43 | + |
| 44 | + public Query(int cityId, IResultProcessor<Data> resultProcessor = null) : base(resultProcessor) |
| 45 | + { |
| 46 | + CityId = cityId; |
| 47 | + } |
| 48 | + |
| 49 | + protected override string QueryText => _query; |
| 50 | + |
| 51 | + protected override Dictionary<string, object> Variables => new Dictionary<string, object> |
| 52 | + { |
| 53 | + { "cityId", CityId } |
| 54 | + }; |
| 55 | + } |
| 56 | + |
| 57 | + public sealed class Data |
| 58 | + { |
| 59 | + [JsonProperty("PromotionSuggestionSettingsByCityPromotionType")] |
| 60 | + public List<PromotionSuggestionSettingsByCityPromotionType> PromotionSuggestionSettingsByCityPromotionType { get; set; } |
| 61 | + } |
| 62 | + |
| 63 | + public sealed class PromotionSuggestion |
| 64 | + { |
| 65 | + [JsonProperty("cityId")] |
| 66 | + public int CityId { get; set; } |
| 67 | + [JsonProperty("promotionTypeId")] |
| 68 | + public int PromotionTypeId { get; set; } |
| 69 | + [JsonProperty("rank")] |
| 70 | + public int Rank { get; set; } |
| 71 | + [JsonProperty("lastUpdatedBy")] |
| 72 | + public string LastUpdatedBy { get; set; } |
| 73 | + [JsonProperty("lastUpdatedWhen")] |
| 74 | + public DateTime? LastUpdatedWhen { get; set; } |
| 75 | + } |
| 76 | + |
| 77 | + public sealed class PromotionSuggestionSettingsByCityPromotionType |
| 78 | + { |
| 79 | + [JsonProperty("id")] |
| 80 | + public int Id { get; set; } |
| 81 | + [JsonProperty("cityId")] |
| 82 | + public int CityId { get; set; } |
| 83 | + [JsonProperty("promotionTypeId")] |
| 84 | + public int PromotionTypeId { get; set; } |
| 85 | + [JsonProperty("startDate")] |
| 86 | + public int StartDate { get; set; } |
| 87 | + [JsonProperty("endDate")] |
| 88 | + public int EndDate { get; set; } |
| 89 | + [JsonProperty("startMonth")] |
| 90 | + public int StartMonth { get; set; } |
| 91 | + [JsonProperty("endMonth")] |
| 92 | + public int EndMonth { get; set; } |
| 93 | + [JsonProperty("discountValue")] |
| 94 | + public double DiscountValue { get; set; } |
| 95 | + [JsonProperty("promotionDiscountTypeId")] |
| 96 | + public int PromotionDiscountTypeId { get; set; } |
| 97 | + [JsonProperty("minAdvPurchase")] |
| 98 | + public int? MinAdvPurchase { get; set; } |
| 99 | + [JsonProperty("maxAdvPurchase")] |
| 100 | + public int? MaxAdvPurchase { get; set; } |
| 101 | + [JsonProperty("stayOn")] |
| 102 | + public string StayOn { get; set; } |
| 103 | + [JsonProperty("minNightsStay")] |
| 104 | + public int? MinNightsStay { get; set; } |
| 105 | + [JsonProperty("bookTimeFrom")] |
| 106 | + public DateTime? BookTimeFrom { get; set; } |
| 107 | + [JsonProperty("bookTimeTo")] |
| 108 | + public DateTime? BookTimeTo { get; set; } |
| 109 | + [JsonProperty("isActive")] |
| 110 | + public bool IsActive { get; set; } |
| 111 | + [JsonProperty("lastUpdatedBy")] |
| 112 | + public string LastUpdatedBy { get; set; } |
| 113 | + [JsonProperty("lastUpdatedWhen")] |
| 114 | + public DateTime? LastUpdatedWhen { get; set; } |
| 115 | + [JsonProperty("PromotionSuggestion")] |
| 116 | + public PromotionSuggestion PromotionSuggestion { get; set; } |
| 117 | + } |
| 118 | +} |
0 commit comments