[{"name":"Cqrs.Command","comment":"\n\n\n## Types\n\n@docs Response\n\n\n## Actions\n\n@docs request, requestTask\n\n\n## Constructors\n\n@docs succeed, fail\n\n\n## Helpers\n\n@docs map, mapError, withDefault, unwrap, succeeded, failed, reason\n\n\n## Codecs\n\n@docs decoder\n\n","unions":[{"name":"Response","comment":" Represents the possible response states of a command.\n","args":["e","a"],"cases":[]}],"aliases":[],"values":[{"name":"decoder","comment":" Decodes a given payload into a `Cqrs.Command.Response`.\n","type":"Json.Decode.Decoder (Cqrs.Command.Response String.String ())"},{"name":"fail","comment":" Constructs the `Failed` variant of a `Cqrs.Command.Response`.\n\nThis is useful for testing how your UI will respond to the sad path, without actually sending a command.\n\n","type":"e -> Cqrs.Command.Response e a"},{"name":"failed","comment":" Checks if a given `Cqrs.Command.Response` is a `Failed` variant.\n\n    failed Succeeded --> False\n\n    failed (Failed \"reason\") --> True\n\n","type":"Cqrs.Command.Response e a -> Basics.Bool"},{"name":"map","comment":" Maps the `Succeeded` variant of a given `Cqrs.Command.Response`\n","type":"(a -> b) -> Cqrs.Command.Response e a -> Cqrs.Command.Response e b"},{"name":"mapError","comment":" Maps the `Failed` variant of a given `Cqrs.Command.Response`.\n","type":"(e -> f) -> Cqrs.Command.Response e a -> Cqrs.Command.Response f a"},{"name":"reason","comment":" If a given `Cqrs.Command.Response` was unsuccessful, the reason for the failure will be returned.\n\n    reason Succeeded --> Nothing\n\n    reason (Failed \"reason\") --> Just \"reason\"\n\n","type":"Cqrs.Command.Response e a -> Maybe.Maybe e"},{"name":"request","comment":" Sends a command to the given URL with the provided body and returns a parsed `Cqrs.Command.Response` in turn.\n","type":"String.String -> Maybe.Maybe (Http.Error -> String.String) -> Json.Encode.Value -> (Cqrs.Command.Response String.String () -> msg) -> Platform.Cmd.Cmd msg"},{"name":"requestTask","comment":" Sends a command to the given URL and returns a `Task` containing the parsed `Cqrs.Command.Response`.\nThe value contained within the `Cqrs.Command.Response`, will be the value parsed via the provided decoder.\n","type":"String.String -> Maybe.Maybe (Http.Error -> String.String) -> Json.Encode.Value -> Task.Task () (Cqrs.Command.Response String.String ())"},{"name":"succeed","comment":" Constructs the `Succeeded` variant of a `Cqrs.Command.Response`.\n\nThis is useful for testing how your UI will respond to the happy path, without actually sending a command.\n\n","type":"Cqrs.Command.Response e ()"},{"name":"succeeded","comment":" Checks if a given `Cqrs.Command.Response` is a `Succeeded` variant.\n\n    succeeded Succeeded --> True\n\n    succeeded (Failed \"reason\") --> False\n\n","type":"Cqrs.Command.Response e a -> Basics.Bool"},{"name":"unwrap","comment":" Unwraps a homogeneous `Cqrs.Command.Response` to its' inner value from the given variant.\n","type":"Cqrs.Command.Response x x -> x"},{"name":"withDefault","comment":" Provides a default case for a `Cqrs.Command.Response` where the `Succeeded` variant is in the default `()` state.\n","type":"e -> Cqrs.Command.Response e () -> e"}],"binops":[]},{"name":"Cqrs.Query","comment":"\n\n\n## Types\n\n@docs Response\n\n\n## Actions\n\n@docs request, requestTask\n\n\n## Constructors\n\n@docs succeed, fail\n\n\n## Helpers\n\n@docs map, mapError, withDefault, succeeded, failed, data, reason\n\n\n## Codecs\n\n@docs decoder\n\n","unions":[{"name":"Response","comment":" Represents the possible response states of a query.\n","args":["e","a"],"cases":[]}],"aliases":[],"values":[{"name":"data","comment":" If a given `Cqrs.Query.Response` was successful, the data it contains will be returned.\n\n    data (Data []) --> Just []\n\n    data (Error \"reason\") --> Nothing\n\n","type":"Cqrs.Query.Response e a -> Maybe.Maybe a"},{"name":"decoder","comment":" Decodes a given payload into a `Cqrs.Query.Response a`.\n","type":"Json.Decode.Decoder a -> Json.Decode.Decoder (Cqrs.Query.Response String.String a)"},{"name":"fail","comment":" Constructs the `Error` variant of a `Cqrs.Query.Response a`.\n\nThis is useful for testing how your UI will respond to the sad path, without actually sending a query.\n\n","type":"e -> Cqrs.Query.Response e a"},{"name":"failed","comment":" Checks if a given `Cqrs.Query.Response` is an `Error` variant.\n\n    failed (Data []) --> False\n\n    failed (Error \"reason\") --> True\n\n","type":"Cqrs.Query.Response e a -> Basics.Bool"},{"name":"map","comment":" Maps the `Data` variant of a given `Cqrs.Query.Response a` and returns a `Cqrs.Query.Response b`.\n","type":"(a -> b) -> Cqrs.Query.Response e a -> Cqrs.Query.Response e b"},{"name":"mapError","comment":" Maps the `Error` variant of a given `Cqrs.Query.Response a`.\n","type":"(e -> f) -> Cqrs.Query.Response e a -> Cqrs.Query.Response f a"},{"name":"reason","comment":" If a given `Cqrs.Query.Response` was unsuccessful, the reason for the failure will be returned.\n\n    reason (Data []) --> Nothing\n\n    reason (Error \"reason\") --> Just \"reason\"\n\n","type":"Cqrs.Query.Response e a -> Maybe.Maybe e"},{"name":"request","comment":" Sends a query to the given URL and returns a `Cmd` for the given `msg` containing the parsed `Cqrs.Query.Response a`.\nThe value contained within the `Cqrs.Query.Response a`, will be the value parsed via the provided decoder.\n","type":"String.String -> Maybe.Maybe (Http.Error -> String.String) -> (Cqrs.Query.Response String.String a -> msg) -> Json.Decode.Decoder a -> Platform.Cmd.Cmd msg"},{"name":"requestTask","comment":" Sends a query to the given URL and returns a `Task` which will contain the parsed `Cqrs.Query.Response a`.\nThe value contained within the `Cqrs.Query.Response a`, will be the value parsed via the provided decoder.\n","type":"String.String -> Maybe.Maybe (Http.Error -> String.String) -> Json.Decode.Decoder a -> Task.Task () (Cqrs.Query.Response String.String a)"},{"name":"succeed","comment":" Constructs the `Data` variant of a `Cqrs.Query.Response a`.\n\nThis is useful for testing how your UI will respond to the happy path, without actually sending a query.\n\n","type":"a -> Cqrs.Query.Response e a"},{"name":"succeeded","comment":" Checks if a given `Cqrs.Query.Response` is a `Data` variant.\n\n    succeeded (Data []) --> True\n\n    succeeded (Error \"reason\") --> False\n\n","type":"Cqrs.Query.Response e a -> Basics.Bool"},{"name":"withDefault","comment":" Provides a default case for a `Cqrs.Query.Response` in place of the value held within the `Error` variant.\n","type":"a -> Cqrs.Query.Response e a -> a"}],"binops":[]}]