Relax JSON schema and update deps
This commit is contained in:
@@ -187,8 +187,7 @@ type GymAttendance =
|
||||
[<JsonRequired>]
|
||||
TotalPeopleInGym : int
|
||||
/// How many people are in classes at the gym as of this statistics snapshot
|
||||
[<JsonRequired>]
|
||||
TotalPeopleInClasses : int
|
||||
TotalPeopleInClasses : int option
|
||||
/// E.g. " or fewer"
|
||||
TotalPeopleSuffix : string option
|
||||
/// Whether the number of people in the gym is approximate. This appears to become true when the number
|
||||
@@ -219,10 +218,10 @@ type GymAttendance =
|
||||
$" out of %i{this.MaximumCapacity} maximum"
|
||||
|
||||
let classes =
|
||||
if this.TotalPeopleInClasses = 0 then
|
||||
""
|
||||
else
|
||||
$"\n%i{this.TotalPeopleInClasses} in classes"
|
||||
match this.TotalPeopleInClasses with
|
||||
| None
|
||||
| Some 0 -> ""
|
||||
| Some totalPeopleInClasses -> $"\n%i{totalPeopleInClasses} in classes"
|
||||
|
||||
$"""%i{this.TotalPeopleInGym}%s{totalPeopleSuffix} in gym%s{capacity} (is exact: %c{Char.emoji (not this.IsApproximate)})%s{classes}
|
||||
Query made at %s{this.AttendanceTime.ToString "s"}%s{this.AttendanceTime.ToString "zzz"}
|
||||
|
@@ -97,7 +97,7 @@ module PureGymApi =
|
||||
| v -> v),
|
||||
System.Uri (
|
||||
"v1/gyms/{gym_id}/attendance"
|
||||
.Replace ("{gym_id}", gymId.ToString () |> System.Web.HttpUtility.UrlEncode),
|
||||
.Replace ("{gym_id}", gymId.ToString () |> System.Uri.EscapeDataString),
|
||||
System.UriKind.Relative
|
||||
)
|
||||
)
|
||||
@@ -133,7 +133,7 @@ module PureGymApi =
|
||||
| v -> v),
|
||||
System.Uri (
|
||||
"v1/gyms/{gym_id}"
|
||||
.Replace ("{gym_id}", gymId.ToString () |> System.Web.HttpUtility.UrlEncode),
|
||||
.Replace ("{gym_id}", gymId.ToString () |> System.Uri.EscapeDataString),
|
||||
System.UriKind.Relative
|
||||
)
|
||||
)
|
||||
@@ -206,9 +206,9 @@ module PureGymApi =
|
||||
else
|
||||
"?")
|
||||
+ "fromDate="
|
||||
+ ((fromDate.ToString "yyyy-MM-dd") |> System.Web.HttpUtility.UrlEncode)
|
||||
+ ((fromDate.ToString "yyyy-MM-dd") |> System.Uri.EscapeDataString)
|
||||
+ "&toDate="
|
||||
+ ((toDate.ToString "yyyy-MM-dd") |> System.Web.HttpUtility.UrlEncode)),
|
||||
+ ((toDate.ToString "yyyy-MM-dd") |> System.Uri.EscapeDataString)),
|
||||
System.UriKind.Relative
|
||||
)
|
||||
)
|
||||
|
@@ -645,16 +645,9 @@ module GymAttendance =
|
||||
| v -> v.AsValue().GetValue<System.String> () |> Some
|
||||
|
||||
let arg_2 =
|
||||
(match node.["totalPeopleInClasses"] with
|
||||
| null ->
|
||||
raise (
|
||||
System.Collections.Generic.KeyNotFoundException (
|
||||
sprintf "Required key '%s' not found on JSON object" ("totalPeopleInClasses")
|
||||
)
|
||||
)
|
||||
| v -> v)
|
||||
.AsValue()
|
||||
.GetValue<System.Int32> ()
|
||||
match node.["totalPeopleInClasses"] with
|
||||
| null -> None
|
||||
| v -> v.AsValue().GetValue<System.Int32> () |> Some
|
||||
|
||||
let arg_1 =
|
||||
(match node.["totalPeopleInGym"] with
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
|
||||
<WarnOn>FS3559</WarnOn>
|
||||
|
||||
<WoofWareMyriadPluginVersion>2.1.53</WoofWareMyriadPluginVersion>
|
||||
<WoofWareMyriadPluginVersion>4.0.9</WoofWareMyriadPluginVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -36,10 +36,10 @@
|
||||
<PackageReference Include="RestEase" Version="1.6.4" />
|
||||
<PackageReference Update="FSharp.Core" Version="6.0.1" />
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.0" />
|
||||
<PackageReference Include="Fastenshtein" Version="1.0.0.8" />
|
||||
<PackageReference Include="Fastenshtein" Version="1.0.10" />
|
||||
<PackageReference Include="Myriad.Sdk" Version="0.8.3" PrivateAssets="all" />
|
||||
<PackageReference Include="WoofWare.Myriad.Plugins" Version="$(WoofWareMyriadPluginVersion)" PrivateAssets="all" />
|
||||
<PackageReference Include="WoofWare.Myriad.Plugins.Attributes" Version="3.1.9" />
|
||||
<PackageReference Include="WoofWare.Myriad.Plugins.Attributes" Version="3.6.6" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user