the-sett/elm-aws-core/5.0.0

NOTE: the latest version is 9.0.0

AWS.Core.Decode

Helper functions for decoding AWS calls.

Helpers

type alias Metadata =
{ requestId : String }

Response meta-data.

type alias Response a =
{ data : a
, metadata : Metadata
}

A response consisting of data and meta-data.

type alias ResponseWrapper a =
{ response : Response a }

A wrapped response

= ResultDecoder String (Decoder a)
| FixedResult a

Decoder type that can take a constant value or decode some string.

dict : Decoder a -> Decoder (Dict String a)

Decodes into a dict using either the standard Dict encoding as records of "Name" and "Value" field pairs.

optional : List String -> Decoder a -> Decoder (Maybe a)

Tries to decode one of an optional set of field names against a decoder. If no matching field succeeds with the decoder, Nothing will be decoded.

required : List String -> Decoder a -> Decoder a

Tries to decode one of an set of field names against a decoder. If no matching field succeeds with the decoder, the decoding will fail.

responseWrapperDecoder : String -> ResultDecoder a -> Decoder (ResponseWrapper a)

Decodes a ResponseWrapper.