diff --git a/PureGym.Test/TestJson.fs b/PureGym.Test/TestJson.fs index 0b8df68..1e97558 100644 --- a/PureGym.Test/TestJson.fs +++ b/PureGym.Test/TestJson.fs @@ -124,7 +124,7 @@ module TestJson = Latitude = 51.480401 } TimeZone = "Europe/London" - ReopenDate = "2021-04-12T00:00:00+01 Europe/London" + ReopenDate = Some "2021-04-12T00:00:00+01 Europe/London" } [ ovalJson, oval ] |> List.map TestCaseData diff --git a/PureGym/Dto.fs b/PureGym/Dto.fs index 175cb97..0ee7a25 100644 --- a/PureGym/Dto.fs +++ b/PureGym/Dto.fs @@ -125,7 +125,7 @@ type Gym = [] TimeZone : string /// This is a date-time in the format yyyy-MM-ddTHH:mm:ss+01 Europe/London - ReopenDate : string + ReopenDate : string option } /// Human-readable representation of the most important information about this gym diff --git a/PureGym/GeneratedDto.fs b/PureGym/GeneratedDto.fs index 4452ee9..f81c848 100644 --- a/PureGym/GeneratedDto.fs +++ b/PureGym/GeneratedDto.fs @@ -232,16 +232,9 @@ module Gym = /// Parse from a JSON node. let jsonParse (node : System.Text.Json.Nodes.JsonNode) : Gym = let ReopenDate = - (match node.["reopenDate"] with - | null -> - raise ( - System.Collections.Generic.KeyNotFoundException ( - sprintf "Required key '%s' not found on JSON object" ("reopenDate") - ) - ) - | v -> v) - .AsValue() - .GetValue () + match node.["reopenDate"] with + | null -> None + | v -> v.AsValue().GetValue () |> Some let TimeZone = (match node.["timeZone"] with diff --git a/PureGym/SurfaceBaseline.txt b/PureGym/SurfaceBaseline.txt index c707f17..5fc5f6f 100644 --- a/PureGym/SurfaceBaseline.txt +++ b/PureGym/SurfaceBaseline.txt @@ -39,7 +39,7 @@ PureGym.AuthTokenModule inherit obj PureGym.AuthTokenModule.get [static method]: PureGym.UsernamePin -> System.Threading.CancellationToken -> PureGym.AuthToken System.Threading.Tasks.Task PureGym.AuthTokenModule.ofBearerToken [static method]: string -> PureGym.AuthToken PureGym.Gym inherit obj, implements PureGym.Gym System.IEquatable, System.Collections.IStructuralEquatable, PureGym.Gym System.IComparable, System.IComparable, System.Collections.IStructuralComparable -PureGym.Gym..ctor [constructor]: (string, int, int, PureGym.GymAddress, string, string, PureGym.GymOpeningHours, PureGym.GymAccessOptions, PureGym.GymLocation, string, string) +PureGym.Gym..ctor [constructor]: (string, int, int, PureGym.GymAddress, string, string, PureGym.GymOpeningHours, PureGym.GymAccessOptions, PureGym.GymLocation, string, string option) PureGym.Gym.AccessOptions [property]: [read-only] PureGym.GymAccessOptions PureGym.Gym.Address [property]: [read-only] PureGym.GymAddress PureGym.Gym.EmailAddress [property]: [read-only] string @@ -51,7 +51,7 @@ PureGym.Gym.get_Id [method]: unit -> int PureGym.Gym.get_Location [method]: unit -> PureGym.GymLocation PureGym.Gym.get_Name [method]: unit -> string PureGym.Gym.get_PhoneNumber [method]: unit -> string -PureGym.Gym.get_ReopenDate [method]: unit -> string +PureGym.Gym.get_ReopenDate [method]: unit -> string option PureGym.Gym.get_Status [method]: unit -> int PureGym.Gym.get_TimeZone [method]: unit -> string PureGym.Gym.GymOpeningHours [property]: [read-only] PureGym.GymOpeningHours @@ -59,7 +59,7 @@ PureGym.Gym.Id [property]: [read-only] int PureGym.Gym.Location [property]: [read-only] PureGym.GymLocation PureGym.Gym.Name [property]: [read-only] string PureGym.Gym.PhoneNumber [property]: [read-only] string -PureGym.Gym.ReopenDate [property]: [read-only] string +PureGym.Gym.ReopenDate [property]: [read-only] string option PureGym.Gym.Status [property]: [read-only] int PureGym.Gym.TimeZone [property]: [read-only] string PureGym.GymAccessOptions inherit obj, implements PureGym.GymAccessOptions System.IEquatable, System.Collections.IStructuralEquatable, PureGym.GymAccessOptions System.IComparable, System.IComparable, System.Collections.IStructuralComparable diff --git a/PureGym/version.json b/PureGym/version.json index d0e7d61..7bf95a3 100644 --- a/PureGym/version.json +++ b/PureGym/version.json @@ -1,5 +1,5 @@ { - "version": "4.0", + "version": "5.0", "publicReleaseRefSpec": [ "^refs/heads/main$" ],