17 using Newtonsoft.Json;
18 using System.Collections.Generic;
19 using System.Text.RegularExpressions;
32 [JsonProperty(PropertyName =
"link")]
33 public string Url {
get;
set; }
38 [JsonProperty(PropertyName =
"balance")]
44 [JsonProperty(PropertyName =
"cost")]
45 public double Cost {
get;
set; }
56 [JsonProperty(PropertyName =
"objects")]
68 [JsonProperty(PropertyName =
"prices")]
69 public List<PriceEntry>
Prices {
get;
set; }
74 [JsonProperty(PropertyName =
"agreement")]
89 var entry =
Prices.FirstOrDefault(x => x.RegEx.IsMatch(path));
90 return entry?.Price ?? -1;
104 [JsonProperty(PropertyName =
"vendorName")]
116 if (_regex ==
null &&
RawRegEx !=
null)
118 _regex =
new Regex(
RawRegEx.TrimStart(
'/').TrimEnd(
'm').TrimEnd(
'/'), RegexOptions.Compiled);
127 [JsonProperty(PropertyName =
"regex")]
133 [JsonProperty(PropertyName =
"price")]
139 [JsonProperty(PropertyName =
"type")]
140 public string Type {
get;
set; }
145 [JsonProperty(PropertyName =
"subscribed")]
151 [JsonProperty(PropertyName =
"productId")]
157 [JsonProperty(PropertyName =
"paths")]
158 public HashSet<string>
Paths {
get;
set; }