[{"name":"Avro","comment":" This module contains top level functions for\nconverting Avro data to and from typed Elm values.\n\nIt is designed to be used with the\n[`Avro.Codec`](Avro-Codec) module.\n\nOne should construct a [`Codec`](Avro-Codec#Codec), then,\nuse the functions below to read and write Avro encoded binary data.\n\n\n# Parsing and writing Avro data\n\n@docs makeDecoder, makeEncoder\n\n\n# Working with named types\n\nIt is common when building Avro schemas traditionally to write small\nschemas for parts of a larger record or set of messages. To do this,\none uses named types to create references so that schema definitions\ncan be simplified and reused.\n\nIn this library, this can be quite simply done for Codecs by using the\n[`namedType`](Avro-Codec#namedType) function from the [`Codec`](Avro-Codec)\nmodule.\n\nTo read and write data which is separated in this manner, one should first\nconstruct an `Environment` for all named types used by the reader and\nwriter. Then, use that environment when constructing a decoder.\n\n@docs Environment, makeDecoderInEnvironment\n\n\n# Json\n\n@docs schemaDecoder, schemaEncoder\n\n@docs valueDecoder, valueEncoder\n\n","unions":[],"aliases":[{"name":"Environment","comment":" Schemas which can be referred to by name in either the readers and writers.\n","args":[],"type":"{ readerEnvironment : List.List Avro.Schema.Schema, writerEnvironment : List.List Avro.Schema.Schema }"}],"values":[{"name":"makeDecoder","comment":" Create a binary decoder for avro data given a Codec and the writer's Schema.\n\nFields in Avro data types are not tagged, and records can only be interpreted\nknowing the exact Schema with which they were written.\n\nTherefore, building a binary decoder not requires a Codec for the type of\ninterest, but also the writer of the data's [`Schema`](Avro-Schema#Schema).\n\n","type":"Avro.Codec.Codec a -> Avro.Schema.Schema -> Result.Result Avro.Schema.SchemaMismatch (Bytes.Decode.Decoder a)"},{"name":"makeDecoderInEnvironment","comment":" Create a binary decoder for avro data given a Codec and the writer's Schema.\n\nThis function will generate a decoder after considering the Named types in the\ndefined set of schemas.\n\n","type":"Avro.Environment -> Avro.Codec.Codec a -> Avro.Schema.Schema -> Result.Result Avro.Schema.SchemaMismatch (Bytes.Decode.Decoder a)"},{"name":"makeEncoder","comment":" Make a binary encoder for data using an Avro Codec\n","type":"Avro.Codec.Codec a -> a -> Bytes.Encode.Encoder"},{"name":"schemaDecoder","comment":" JSON decoder for an Avro Schema\n","type":"Json.Decode.Decoder Avro.Schema.Schema"},{"name":"schemaEncoder","comment":" JSON encoder for an Avro Schema\n","type":"Avro.Schema.Schema -> Json.Encode.Value"},{"name":"valueDecoder","comment":" JSON decoder for an Avro Value\n","type":"Avro.Schema.Schema -> Json.Decode.Decoder Avro.Value.Value"},{"name":"valueEncoder","comment":" JSON encoder for an Avro Value\n","type":"Avro.Schema.Schema -> Avro.Value.Value -> Json.Encode.Value"}],"binops":[]},{"name":"Avro.Codec","comment":" This modules defines how to build Avro Codecs.\n\nCodec's represent how to encode and decode data for\nyour domain types, as well as the schema with which\nthey will be written.\n\nFor example, below we define a type alias and how it\nwould be represented as an Avro record\n\n    type alias Person =\n        { name : String, age : Maybe Int }\n\n    personCodec : Codec Person\n    personCodec =\n        success Person\n            |> requiring \"name\" string .name\n            |> optional \"age\" int .age\n            |> record { baseName = \"person\", nameSpace = [] }\n\nFurthermore, one of several variants in an Avro union can represent\nan Elm custom type, by using the [`union`](Avro-Codec#union) family\nof functions\n\n    personOrPetCodec : Codec (Result Person Pet)\n    personOrPetCodec =\n        union personCodec petCodec\n\nRecords, unions, [named types](Avro-Codec#namedType), and basic\ntypes can be composed to easily represent complex models.\n\n\n# Core Type\n\n@docs Codec\n\n@docs imap, emap\n\n@docs withDocumentation, withAliases, withLogicalType\n\n\n## Basic Builders\n\n@docs int, bool, long, int64, float32, float64, null, string, array, dict, enum, namedType\n\n\n# Working with Record Types\n\nRecords are easily constructed using a pipeline style to compose\nfield Codecs.\n\n    success Person\n        |> requiring \"name\" string .name\n        |> optional \"age\" int .age\n        |> record { baseName = \"person\", nameSpace = [] }\n\n\n## Core types\n\n@docs StructCodec, StructBuilder\n\n\n## Construction\n\n@docs record, success, requiring, optional, withFallback, withField\n\n\n# Working with Union Types\n\nUnion types are similar to User defined types, and can be used to\nencode them from Elm.\n\nThese functions will ensure that unions don't directly contain\nother unions (which would violate the Avro specification), but\none should also ensure that type names aren't replicated in the\nresulting union.\n\nThe best way to achieve this is to use these functions with record\ntypes of distinct names where possible.\n\n@docs maybe, union, union3, union4, union5\n\n\n# Working with Recursive Types\n\n@docs recursiveRecord\n\n\n# Fancy Records\n\nThese functions are lower level than those above, but provide an\nalternative method for building records.\n\n@docs structField, using\n\n@docs dimap, lmap, map, map2, map3, map4\n\n","unions":[{"name":"StructBuilder","comment":" Builder for a Struct Codec.\n\nThe first type parameter `b` is the type we're mapping from when writing\nan Avro record, the second type parameter `a` is the type we're reading\navro data into. When a builder is completely constructed, the types `a`\nand `b` will be for the same type, and can be turned into a `Codec a`\nusing the `record` function.\n\nThe technical term for a type like this is that `StructBuilder` is an\napplicative profunctor; it wraps a parser and a builder for lists of\nAvro fields (along with their Schemas).\n\nThe usual pattern is to use the [`requiring`](Avro-Codec#requiring),\nor [`optional`](Avro-Codec#optional) functions to chain together a\nsequence of codecs for each field in turn.\n\n","args":["b","a"],"cases":[]}],"aliases":[{"name":"Codec","comment":" This type defines the schema, encoder, and decoder for an\nelm type.\n","args":["a"],"type":"{ schema : Avro.Schema.Schema, decoder : Avro.Value.Value -> Maybe.Maybe a, writer : a -> Avro.Value.Value }"},{"name":"StructCodec","comment":" Definition of a Struct Codec\n\nUsually one will work with this type alias\ndirectly, as the builder is most useful when\ncontructing the final value.\n\n","args":["a"],"type":"Avro.Codec.StructBuilder a a"}],"values":[{"name":"array","comment":" A Codec for an array type\n","type":"Avro.Codec.Codec a -> Avro.Codec.Codec (List.List a)"},{"name":"bool","comment":" A Codec for a boolean type\n","type":"Avro.Codec.Codec Basics.Bool"},{"name":"dict","comment":" A Codec for a map type.\n","type":"Avro.Codec.Codec a -> Avro.Codec.Codec (Dict.Dict String.String a)"},{"name":"dimap","comment":" Profunctor mapping of struct codec.\n","type":"(x -> y) -> (a -> b) -> Avro.Codec.StructBuilder y a -> Avro.Codec.StructBuilder x b"},{"name":"emap","comment":" Partially map a Codec to a new type.\n\nLike [`imap`](Avro-Codec#imap) this function requires a _from_ and _to_\nmapping to the new type, but this also allows one to fail to parse an\nunexpected value.\n\nFor example, the Logical UUID Type is backed by an Avro string.\nAs not all strings are valid UUIDs, this function would be used to\nprint and parse the string. Using the\n[`elm-uuid`](https://package.elm-lang.org/packages/NoRedInk/elm-uuid/2.0.0/)\nlibrary:\n\n    import Prng.Uuid as Uuid exposing (Uuid)\n\n    uuid : Codec Uuid\n    uuid =\n        string\n            |> emap Uuid.toString Uuid.fromString\n            |> withLogicalType \"uuid\"\n\nThis function can be overused as if the mapping fails the user\nwill receive a parse error from the binary decoder, and lose any\nspecific information as to the nature of the error.\n\n","type":"(b -> a) -> (a -> Maybe.Maybe b) -> Avro.Codec.Codec a -> Avro.Codec.Codec b"},{"name":"enum","comment":" Construct a Avro enumeration encoded with a 0 base index.\n\nArguments are:\n\n  - The name of the enum;\n  - A list of symbols which the enum represents; and\n  - An optional default, used when the reader encounters a symbol from\n    the writer that isn’t defined in the reader’s original set of symbols.\n\nThis can be used with [`emap`](Avro-Codec#emap) to map to a custom type.\n\n","type":"Avro.Name.TypeName -> List.List String.String -> Maybe.Maybe String.String -> Avro.Codec.Codec Basics.Int"},{"name":"float32","comment":" A Codec for a float type\n\n_Warning:_ This uses an elm `Float` type to encode from, which is\na 64 bit type underneath. Using `double` may be a better choice unless\nan expected reader can only accept a 32 bit float.\n\n","type":"Avro.Codec.Codec Basics.Float"},{"name":"float64","comment":" A Codec for a double type\n","type":"Avro.Codec.Codec Basics.Float"},{"name":"imap","comment":" Map a Codec to a new type.\n\nA Codec can transform data _from_ avro, as well as _to_ avro.\nTherefore to change its type, you need to provide function to\ntransform back and forth between the original type and the new\ntype.\n\nThe categorical term for this is that Codec is an\ninvariant functor, you can map between isomorphic types.\n\nThe main utility of this is transforming basic types to custom\ntypes.\n\nFor example, here's the definition of the `maybe` function, which\nuses `imap` with `union`.\n\n    maybe : Codec b -> Codec (Maybe b)\n    maybe just =\n        let\n            note =\n                Result.fromMaybe ()\n        in\n        imap note Result.toMaybe <|\n            union null just\n\n","type":"(b -> a) -> (a -> b) -> Avro.Codec.Codec a -> Avro.Codec.Codec b"},{"name":"int","comment":" A Codec for an int type\n","type":"Avro.Codec.Codec Basics.Int"},{"name":"int64","comment":" A Codec for a long type.\n\n_Nota bene:_ Elm integers cannot represent the full 64 bit range\non standard platforms. This Codec employs two Ints using their\n32 bit range to encode a single 64 bit signed integer.\n\n","type":"Avro.Codec.Codec Avro.Value.Int64.Int64"},{"name":"lmap","comment":" Contravariant mapping of struct codec.\n","type":"(x -> y) -> Avro.Codec.StructBuilder y a -> Avro.Codec.StructBuilder x a"},{"name":"long","comment":" A Codec for a long type.\n\n_Nota bene:_ This parses to an elm `Int` type, which has a maximum\nprecision of 53 bits. Numbers larger than this will fail to parse,\nyielding a decoding error.\n\n","type":"Avro.Codec.Codec Basics.Int"},{"name":"map","comment":" Mapping of struct codec.\n","type":"(a -> b) -> Avro.Codec.StructBuilder x a -> Avro.Codec.StructBuilder x b"},{"name":"map2","comment":" Apply a function through struct codecs.\n\nThis can be used as an alternative to [`using`](Avro-Codec#using)\n\n","type":"(a -> b -> c) -> Avro.Codec.StructBuilder y a -> Avro.Codec.StructBuilder y b -> Avro.Codec.StructBuilder y c"},{"name":"map3","comment":" Apply a function through struct codecs.\n","type":"(a -> b -> c -> d) -> Avro.Codec.StructBuilder y a -> Avro.Codec.StructBuilder y b -> Avro.Codec.StructBuilder y c -> Avro.Codec.StructBuilder y d"},{"name":"map4","comment":" Apply a function through struct codecs.\n\nTo map across more fields, one can build additional layers with `using`.\n\n    map5 f a b c d e =\n        map4 f a b c d\n            |> using e\n\n","type":"(a -> b -> c -> d -> e) -> Avro.Codec.StructBuilder y a -> Avro.Codec.StructBuilder y b -> Avro.Codec.StructBuilder y c -> Avro.Codec.StructBuilder y d -> Avro.Codec.StructBuilder y e"},{"name":"maybe","comment":" A codec for a potentially missing value.\n\nIf using this in a record, it may be best to use the\n[`optional`](Avro-Codec#optional) function instead, as that will\napply this function as well as setting a default value.\n\n","type":"Avro.Codec.Codec b -> Avro.Codec.Codec (Maybe.Maybe b)"},{"name":"namedType","comment":" Use a Codec as a Named Type.\n\nThe Schema for this Codec will only be its name. This can be\nuseful to separate definitions logically and share them.\n\nWhen using this function, one will need to put the original\nschema in an environment before resolving reader and writer\nschemas.\n\n","type":"Avro.Codec.Codec a -> Avro.Codec.Codec a"},{"name":"null","comment":" A Codec for an avro null type\n","type":"Avro.Codec.Codec ()"},{"name":"optional","comment":" Compose an optional field's Codec to build a record.\n\nThis will create a union in the Schema with null as the first field\nand set a default value of null.\n\n","type":"String.String -> Avro.Codec.Codec a -> (c -> Maybe.Maybe a) -> Avro.Codec.StructBuilder c (Maybe.Maybe a -> b) -> Avro.Codec.StructBuilder c b"},{"name":"record","comment":" Build a Codec for an Avro record from a StructCodec.\n\nThis function requires a \"completed\" StructCodec, which writes and reads\nthe same type.\n\n","type":"Avro.Name.TypeName -> Avro.Codec.StructCodec a -> Avro.Codec.Codec a"},{"name":"recursiveRecord","comment":" Build a record type which may be recursive, by providing a `Codec`\nwhich embeds the record as a NamedType in the Schema.\n\n    type LinkedList\n        = LinkedList Int (Maybe LinkedList)\n\n    linkedCodec : Codec LinkedList\n    linkedCodec =\n        let\n            struct rec =\n                success LinkedList\n                    |> requiring \"item\" int (\\(LinkedList a _) -> a)\n                    |> optional \"rest\" rec (\\(LinkedList _ a) -> a)\n        in\n        struct\n            |> recursiveRecord { baseName = \"LinkedList\", nameSpace = [] }\n\n","type":"Avro.Name.TypeName -> (Avro.Codec.Codec a -> Avro.Codec.StructCodec a) -> Avro.Codec.Codec a"},{"name":"requiring","comment":" Compose a required field's Codecs to build a record.\n\nThis function is designed to be used in a pipeline, and therefore consumes\nfields in order when written in this style. For example:\n\n    success Person\n        |> requiring \"name\" string .name\n        |> requiring \"age\" int .age\n\nWill expect a string column then an int column in the record; and apply the\nconstructor Person to the arguments in that order.\n\nThe explicit arguments one should write are:\n\n  - The field name which will be written into the Avro Schema;\n  - The Codec for the individual field; and\n  - How to extract the fields from the type in order to write it.\n\nThe final argument in the type signature is the pipelined builder for the\nrecord under construction.\n\n","type":"String.String -> Avro.Codec.Codec a -> (c -> a) -> Avro.Codec.StructBuilder c (a -> b) -> Avro.Codec.StructBuilder c b"},{"name":"string","comment":" A Codec for a string type\n","type":"Avro.Codec.Codec String.String"},{"name":"structField","comment":" Construct a struct parser from a Codec.\n\nUsually one can use the [`requiring`](Avro-Codec#requiring), or [`optional`](Avro-Codec#optional)\nfaimly of functions to chain together a sequence of point parsers.\n\nThe earlier example is equivalent to:\n\n    example =\n        success Person\n            |> using (structField name [] Nothing Nothing string Nothing |> lmap .name)\n            |> using (structField age [] Nothing Nothing int Nothing |> lmap .age)\n\n    example2 =\n        map2 Person\n            (structField \"name\" [] Nothing Nothing string Nothing |> lmap .name)\n            (structField \"age\" [] Nothing Nothing int Nothing |> lmap .age)\n\n","type":"String.String -> List.List String.String -> Maybe.Maybe String.String -> Maybe.Maybe Avro.Schema.SortOrder -> Avro.Codec.Codec a -> Maybe.Maybe a -> Avro.Codec.StructCodec a"},{"name":"success","comment":" A struct builder which parses and writes no fields and always succeeds.\n","type":"a -> Avro.Codec.StructBuilder b a"},{"name":"union","comment":" Construct a Codec for an Avro union.\n\nAs Avro unions can not be nested (i.e., they can not directly contain\nother unions) this function takes care to flatten unions passed in to\nit.\n\nOften it is useful to use the [`imap`](Avro-Codec#imap) function to\nturn this into a Custom Type.\n\n","type":"Avro.Codec.Codec a -> Avro.Codec.Codec b -> Avro.Codec.Codec (Result.Result a b)"},{"name":"union3","comment":" Construct a union from 3 codecs.\n","type":"Avro.Codec.Codec a -> Avro.Codec.Codec b -> Avro.Codec.Codec c -> Avro.Codec.Codec (Result.Result a (Result.Result b c))"},{"name":"union4","comment":" Construct a union from 4 codecs.\n","type":"Avro.Codec.Codec a -> Avro.Codec.Codec b -> Avro.Codec.Codec c -> Avro.Codec.Codec d -> Avro.Codec.Codec (Result.Result a (Result.Result b (Result.Result c d)))"},{"name":"union5","comment":" Construct a union from 5 codecs.\n","type":"Avro.Codec.Codec a -> Avro.Codec.Codec b -> Avro.Codec.Codec c -> Avro.Codec.Codec d -> Avro.Codec.Codec e -> Avro.Codec.Codec (Result.Result a (Result.Result b (Result.Result c (Result.Result d e))))"},{"name":"using","comment":" Apply a function across 2 codecs.\n\nThis can also be used with `success` if a part of a constructor is not to\nbe included in the Avro definition at all.\n\n","type":"Avro.Codec.StructBuilder c a -> Avro.Codec.StructBuilder c (a -> b) -> Avro.Codec.StructBuilder c b"},{"name":"withAliases","comment":" Add aliases to a Codec.\n\nIf the Schema does not support aliases (i.e, it's not a named type)\nthis function has no effect.\n\n","type":"List.List Avro.Name.TypeName -> Avro.Codec.Codec a -> Avro.Codec.Codec a"},{"name":"withDocumentation","comment":" Add documentation to a Codec.\n\nIf the Schema does not support documentation (i.e, it's not a Record or Enum)\nthis function has no effect.\n\n","type":"String.String -> Avro.Codec.Codec a -> Avro.Codec.Codec a"},{"name":"withFallback","comment":" Use a field in a struct codec which falls back if it doesn't exist.\n\nIn the avro specification, the default value for Union values must be\na value from the first sub-schema of the union. If the default value\nviolates this contstraint it will not be emitted when serializing the\nSchema to JSON.\n\n","type":"String.String -> Avro.Codec.Codec a -> a -> (c -> a) -> Avro.Codec.StructBuilder c (a -> b) -> Avro.Codec.StructBuilder c b"},{"name":"withField","comment":" Use a field in a struct codec, supplying all possible parts.\n\nIf you need to add documentation, ordering, or aliases, this function allows full customisation of the\nstruct field.\n\nThe arguments are:\n\n  - name\n  - aliases\n  - documentation\n  - ordering\n  - point codec\n  - default value\n  - extractor\n\n","type":"String.String -> List.List String.String -> Maybe.Maybe String.String -> Maybe.Maybe Avro.Schema.SortOrder -> Avro.Codec.Codec a -> Maybe.Maybe a -> (c -> a) -> Avro.Codec.StructBuilder c (a -> b) -> Avro.Codec.StructBuilder c b"},{"name":"withLogicalType","comment":" Add a logical type annotation to a Codec.\n","type":"String.String -> Avro.Codec.Codec a -> Avro.Codec.Codec a"}],"binops":[]},{"name":"Avro.Name","comment":" Definitions and helpers for Avro Names.\n\nRecord, Enum and Fixed types are _named_ types. Each has a full name that is composed of two parts;\na name and a namespace. Equality of names is defined on the full name.\n\nA namespace is list of scoping names, encoded in the interface description language and Json specification\nlanguage as a dot separated string, but here as an Elm list.\n\nThe empty string may also be used as a namespace to indicate the null namespace.\nEquality of names (including field names and enum symbols) as well as fullnames is case-sensitive.\n\nRecord fields and enum symbols have names as well (but no namespace). Equality of fields and\nenum symbols is defined on the name of the field/symbol within its scope (the record/enum that\ndefines it). Fields and enum symbols across scopes are never equal.\n\nThe name portion of the full name of named types, record field names, and enum symbols must:\n\n  - start with [A-Za-z\\_][A-Za-z_]\n  - subsequently contain only [A-Za-z0-9\\_][A-Za-z0-9_]\n\n\n# Definition\n\n@docs TypeName\n\n\n# Functions\n\n@docs contextualTypeName, canonicalName\n\n@docs compatibleNames, validName\n\n","unions":[],"aliases":[{"name":"TypeName","comment":" An Avro Type Name\n\nThis constructor is exposed, but one should only build names which\nare correctly scoped and have valid names.\n\nIf unsure, one should use [`contextualTypeName`](Avro-Name#contextualTypeName)\nto parse the data instead.\n\n","args":[],"type":"{ baseName : String.String, nameSpace : List.List String.String }"}],"values":[{"name":"canonicalName","comment":" Normalise a TypeName.\n\nThis replaces short names with fullnames, using applicable namespaces\nto do so, then eliminate namespace attributes, which are now redundant.\n\n","type":"Avro.Name.TypeName -> Avro.Name.TypeName"},{"name":"compatibleNames","comment":" Whether two names are compatible for Schema resolution.\n\nThis means that either the unqualified names match, or an alias matches\nthe fully qualified name.\n\n","type":"{ reader | name : Avro.Name.TypeName, aliases : List.List Avro.Name.TypeName } -> { writer | name : Avro.Name.TypeName } -> Basics.Bool"},{"name":"contextualTypeName","comment":" Build a TypeName from using the name and namespace fields within a context.\n\nRules for this are specified in [the avro specification](https://avro.apache.org/docs/1.11.1/specification/#names).\n\nArguments:\n\n  - Optional context (parent name)\n  - Name\n  - Optional Namespace\n\n","type":"Maybe.Maybe Avro.Name.TypeName -> String.String -> Maybe.Maybe String.String -> Result.Result String.String Avro.Name.TypeName"},{"name":"validName","comment":" Test that a `TypeName` is valid\n\nThat is, test that\n\n  - start with [A-Za-z\\_][A-Za-z_]\n  - subsequently contain only [A-Za-z0-9\\_][A-Za-z0-9_]\n\n","type":"Avro.Name.TypeName -> Result.Result String.String Avro.Name.TypeName"}],"binops":[]},{"name":"Avro.Schema","comment":" This module defines core Avro Schema types and functions\nfor working with them.\n\n\n# Definition\n\n@docs Schema\n\n@docs Field\n\n@docs SortOrder\n\n\n# Helpers\n\n@docs typeName, withDocumentation, withAliases, withLogicalType\n\n\n# Error handling\n\n@docs SchemaMismatch, showSchemaMismatch\n\n\n# Schema Validation\n\n@docs SchemaInvalid, showSchemaInvalid, validateSchema\n\n\n# Canonical Form\n\n@docs canonicalise\n\n","unions":[{"name":"Schema","comment":" An Avro Schema\n","args":[],"cases":[["Null",[]],["Boolean",[]],["Int",["{ logicalType : Maybe.Maybe String.String }"]],["Long",["{ logicalType : Maybe.Maybe String.String }"]],["Float",[]],["Double",[]],["Bytes",["{ logicalType : Maybe.Maybe String.String }"]],["String",["{ logicalType : Maybe.Maybe String.String }"]],["Array",["{ items : Avro.Schema.Schema }"]],["Map",["{ values : Avro.Schema.Schema }"]],["NamedType",["Avro.Name.TypeName"]],["Record",["{ name : Avro.Name.TypeName, aliases : List.List Avro.Name.TypeName, doc : Maybe.Maybe String.String, fields : List.List Avro.Schema.Field }"]],["Enum",["{ name : Avro.Name.TypeName, aliases : List.List Avro.Name.TypeName, doc : Maybe.Maybe String.String, symbols : List.List String.String, default : Maybe.Maybe String.String }"]],["Union",["{ options : List.List Avro.Schema.Schema }"]],["Fixed",["{ name : Avro.Name.TypeName, aliases : List.List Avro.Name.TypeName, size : Basics.Int, logicalType : Maybe.Maybe String.String }"]]]},{"name":"SchemaInvalid","comment":" Errors which can occur when a Schema is poorly described.\n","args":[],"cases":[["SchemaNestedUnion",[]],["SchemaIdenticalNamesInUnion",["Avro.Name.TypeName"]],["SchemaHasInvalidFieldName",["Avro.Name.TypeName","String.String","String.String"]],["SchemaHasInvalidName",["Avro.Name.TypeName","String.String"]],["SchemaHasDuplicateEnumValue",["Avro.Name.TypeName","String.String"]],["SchemaEnumDefaultNotFound",["Avro.Name.TypeName","String.String"]],["SchemaRedefinedType",["Avro.Name.TypeName"]]]},{"name":"SchemaMismatch","comment":" Errors which can occur when trying to read Avro with\nan incompatible Schema.\n","args":[],"cases":[["TypeMismatch",["Avro.Schema.Schema","Avro.Schema.Schema"]],["MissingField",["Avro.Name.TypeName","String.String"]],["FieldMismatch",["Avro.Name.TypeName","String.String","Avro.Schema.SchemaMismatch"]],["MissingUnion",["Avro.Name.TypeName"]],["MissingSymbol",["String.String"]],["NamedTypeUnresolved",["Avro.Name.TypeName"]],["FixedWrongSize",["Avro.Name.TypeName","Basics.Int","Basics.Int"]]]},{"name":"SortOrder","comment":" Field Sort ordering\n","args":[],"cases":[["Ascending",[]],["Descending",[]],["Ignore",[]]]}],"aliases":[{"name":"Field","comment":" The Field of a Record\n","args":[],"type":"{ name : String.String, aliases : List.List String.String, doc : Maybe.Maybe String.String, order : Maybe.Maybe Avro.Schema.SortOrder, type_ : Avro.Schema.Schema, default : Maybe.Maybe Avro.Value.Value }"}],"values":[{"name":"canonicalise","comment":" Turn an Avro schema into its [canonical form](https://avro.apache.org/docs/1.11.1/specification/#parsing-canonical-form-for-schemas).\n\nSchema canonical form can be used to determine if two schemas are\nfunctionally equivalent for writing Avro values, as it strips\ndocumentation and aliases as well as normalises names and\nrendering.\n\nWhile canonical form technically refers to a formatted JSON string\nwith no whitespace between terms, this function only transforms a\nSchema value, and one should compose the following functions if the\ncanonical form string is required.\n\n    import Avro\n    import Avro.Schema as Schema exposing (Schema)\n    import Json.Encode as Encode\n\n    renderCanonical : Schema -> String\n    renderCanonical s =\n        Schema.canonical s\n            |> Avro.schemaEncoder\n            |> Encode.encode 0\n\n","type":"Avro.Schema.Schema -> Avro.Schema.Schema"},{"name":"showSchemaInvalid","comment":" Display a Schema invalid error.\n","type":"Avro.Schema.SchemaInvalid -> String.String"},{"name":"showSchemaMismatch","comment":" Display a Schema mismatch error.\n","type":"Avro.Schema.SchemaMismatch -> String.String"},{"name":"typeName","comment":" Get the TypeName for an Avro Schema\n\nFor primitive types, this is an unqualified name, but for\ncomplex types it may be qualified.\n\n","type":"Avro.Schema.Schema -> Avro.Name.TypeName"},{"name":"validateSchema","comment":" Validates an Avro schema.\n\nSchema's produced using the Codec module or parsed from JSON are typically\nvalid, but there are some ways to create invalid Schemas which may not be\nwell received by other implementations.\n\nThis function checks for the following infelicities:\n\n  - Unions must not directly contain other unions,\n  - Unions must not ambiguous (contain more than one schemas with the same\n    name or simple type),\n  - Enums must not have duplicate values,\n  - Enums with a default values must include the value in their options,\n  - Type names and record field names are valid, and\n  - Named types are not defined more than once.\n\nOther things which are currently not covered by this function:\n\n  - Default values are of the correct type.\n\nThe JSON parser will not parse schemas with invalid names or values of the\nwrong type.\n\nIf working with multiple Codecs, it can be a good idea to include a test in\nyour test suite applying this function to your Codec schemas.\n\n","type":"Avro.Schema.Schema -> Result.Result Avro.Schema.SchemaInvalid ()"},{"name":"withAliases","comment":" Add aliases to a Schema.\n\nIf the Schema does not support aliases (i.e, it's not a named type)\nthis function has no effect.\n\n","type":"List.List Avro.Name.TypeName -> Avro.Schema.Schema -> Avro.Schema.Schema"},{"name":"withDocumentation","comment":" Add documentation to a Schema.\n\nIf the Schema does not support documentation (i.e, it's not a Record or Enum)\nthis function has no effect.\n\n","type":"String.String -> Avro.Schema.Schema -> Avro.Schema.Schema"},{"name":"withLogicalType","comment":" Add a logical type to a Schema.\n\nIf the Schema does not support a logical type, (e.g., it's a named type)\nthis function has no effect.\n\n","type":"String.String -> Avro.Schema.Schema -> Avro.Schema.Schema"}],"binops":[]},{"name":"Avro.Value","comment":" This module defines a representation of an Avro value.\n\nOne usually doesn't need to use this module,\nas decoding straight to an Elm domain type via a [`Codec`](Avro-Codec#Codec)\nis better in most situations.\n\nThis type is exposed though as it can be used to build a\nrender function for Avro values of arbitrary types, which\ncould be useful for a monitoring tool.\n\n\n# Definition\n\n@docs Value\n\n","unions":[{"name":"Value","comment":" Avro Value types\n\nA Value in Avro can only be interpreted within the\ncontext of a Schema.\n\nFor example, records are written in field order.\n\n","args":[],"cases":[["Null",[]],["Boolean",["Basics.Bool"]],["Int",["Basics.Int"]],["Long",["Avro.Value.Int64.Int64"]],["Float",["Basics.Float"]],["Double",["Basics.Float"]],["Bytes",["Bytes.Bytes"]],["String",["String.String"]],["Array",["List.List Avro.Value.Value"]],["Map",["Dict.Dict String.String Avro.Value.Value"]],["Record",["List.List Avro.Value.Value"]],["Union",["Basics.Int","Avro.Value.Value"]],["Fixed",["Bytes.Bytes"]],["Enum",["Basics.Int"]]]}],"aliases":[],"values":[],"binops":[]},{"name":"Avro.Value.Int64","comment":" This module implents a signed 64 bit integer.\n\nJavascript platforms do not natively have a signed 64\nbit integer type, though the Avro specification\nassumes the existence of one.\n\n@docs Int64\n\n@docs fromInt, toInt, fromPair, toPair, toFloat\n\n@docs compare\n\n","unions":[],"aliases":[{"name":"Int64","comment":" A 64 bit signed integer.\n\nThis type is encoded using two Int values by the\nconcatentation of their bitwise representations.\n\n","args":[],"type":"Avro.Internal.Int64.Int64"}],"values":[{"name":"compare","comment":" Compare 2 64 bit signed integers.\n","type":"Avro.Value.Int64.Int64 -> Avro.Value.Int64.Int64 -> Basics.Order"},{"name":"fromInt","comment":" Create a 64 bit integer from an Elm Int.\n\nThis is guaranteed to work for integers within the\njavascript safe integer range.\n\n","type":"Basics.Int -> Avro.Value.Int64.Int64"},{"name":"fromPair","comment":" Build a long from upper and lower bits of ints.\n","type":"Basics.Int -> Basics.Int -> Avro.Value.Int64.Int64"},{"name":"toFloat","comment":" Create a standard `Float` value from an Int64.\n\nThis will lose precision beyond the javascript safe integer range.\n\n","type":"Avro.Value.Int64.Int64 -> Basics.Float"},{"name":"toInt","comment":" Build a standard Int from an Int64.\n\nThis will return integers within the javacript safe\nrange; values outside of this will result in a `Nothing`.\n\n","type":"Avro.Value.Int64.Int64 -> Maybe.Maybe Basics.Int"},{"name":"toPair","comment":" Render an Int64 to a pair of upper and lower bit ints.\n","type":"Avro.Value.Int64.Int64 -> ( Basics.Int, Basics.Int )"}],"binops":[]}]