[{"name":"Grpc","comment":" This is the public API for gRPC application usage. It is intended to be imported qualified.\n\n\n# Main Types\n\n@docs Rpc, RpcRequest, new\n\n\n# Configuring the request\n\n@docs addHeader, addHeaders, setHost, setTimeout, setTracker, withRisk\n\n\n# Sending the request\n\n@docs toTask, toCmd\n\n\n# Handling Errors\n\n@docs Error, GrpcStatus\n\n","unions":[{"name":"Error","comment":" A gRPC request may fail with in a variety of ways.\nSince the request is just a HTTP request under the hood, it may fail in the roughly same ways a HTTP request could.\n\n  - `BadUrl` means you did not provide a valid URL.\n\n  - `Timeout` means it took too long to get a response.\n\n  - `NetworkError` means the user turned off their wifi, went in a cave, etc.\n\n  - `BadStatus` means you got a response back, but the http status code indicates failure. This can be either\n    a bad HTTP status code or a bad `grpc-status` response header according to\n    <https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md>\n\n  - `BadBody` means you got a response back with a nice status code, but the body\n    of the response was something unexpected. The `Bytes` in this case is the response that failed to be parsed.\n\n  - `UnknownGrpcStatus` means you got a response back but the `grpc-status` header was set to either\n\n```\n  - something that is not an `Int`\n  - an `Int` that is outside of the range of the `ErrCode` enum.\n\nNote that not setting the header is fine and will delegate failure checking to the HTTP status.\n```\n\n","args":[],"cases":[["BadUrl",["String.String"]],["Timeout",[]],["NetworkError",[]],["BadStatus",["{ metadata : Http.Metadata, response : Bytes.Bytes, errMessage : String.String, status : Grpc.GrpcStatus }"]],["BadBody",["Bytes.Bytes"]],["UnknownGrpcStatus",["String.String"]]]},{"name":"GrpcStatus","comment":" A valid `grpc-status` header encodes one of these possibilities as an Int.\n\n  - `0` -> Ok\\_\n  - `1` -> Cancelled\n  - `2` -> Unknown\n  - ...\n\n","args":[],"cases":[["Ok_",[]],["Cancelled",[]],["Unknown",[]],["InvalidArgument",[]],["DeadlineExceeded",[]],["NotFound",[]],["AlreadyExists",[]],["PermissionDenied",[]],["ResourceExhausted",[]],["FailedPrecondition",[]],["Aborted",[]],["OutOfRange",[]],["Unimplemented",[]],["Internal",[]],["Unavailable",[]],["DataLoss",[]],["Unauthenticated",[]]]}],"aliases":[{"name":"Rpc","comment":" Opaque type for an rpc endpoint. These should be constructed by the `protoc-gen-elm` code generator.\nIf for some reason, you need to define an endpoint by hand, you can do so by importing the `Grpc.Internal` module.\n","args":["req","res"],"type":"Grpc.Internal.Rpc req res"},{"name":"RpcRequest","comment":" A request to the server that has not been sent yet. This is designed to be used in a builder-pattern kind of way:\n\n    Grpc.new helloWorld \"hello\"\n        |> Grpc.addHeader \"authorization\" token\n        |> Grpc.setHost \"http://example.com\"\n\n    In this example `helloWorld` could be a value of type `Rpc String String` that was generated by `protoc-gen-elm`.\n\n","args":["req","res"],"type":"Grpc.InternalRpcRequest req res Basics.Never"}],"values":[{"name":"addHeader","comment":" Add a header to a request. The first parameter is the header name, the second parameter is the value.\n","type":"String.String -> String.String -> Grpc.InternalRpcRequest req res usesTracker -> Grpc.InternalRpcRequest req res usesTracker"},{"name":"addHeaders","comment":" Add multiple headers at once to a request.\n","type":"List.List ( String.String, String.String ) -> Grpc.InternalRpcRequest req res usesTracker -> Grpc.InternalRpcRequest req res usesTracker"},{"name":"new","comment":" Build a request from an rpc endpoint by providing a request body.\n","type":"Grpc.Rpc req res -> req -> Grpc.RpcRequest req res"},{"name":"setHost","comment":" Set the host for the request. By default the host is empty (i.e. the current website), which is recommended to avoid CORS issues.\n","type":"String.String -> Grpc.InternalRpcRequest req res usesTracker -> Grpc.InternalRpcRequest req res usesTracker"},{"name":"setTimeout","comment":" Make the request cancel itself after a given timeout in milliseconds.\n","type":"Basics.Float -> Grpc.InternalRpcRequest req res usesTracker -> Grpc.InternalRpcRequest req res usesTracker"},{"name":"setTracker","comment":" The tracker lets you cancel and track requests via `Http.cancel` and `Http.track`.\nThis only works if you use `toCmd` to send your Request, Tasks unfortunately do not support this.\nWe use the type system to our advantage here to prevent you from calling `toTask` after using this function.\n","type":"String.String -> Grpc.InternalRpcRequest req res usesTracker -> Grpc.InternalRpcRequest req res ()"},{"name":"toCmd","comment":" Convert the given `RpcRequest` into a Command to make the Elm runtime execute the request.\n","type":"(Result.Result Grpc.Error res -> msg) -> Grpc.InternalRpcRequest req res usesTracker -> Platform.Cmd.Cmd msg"},{"name":"toTask","comment":" Convert the given `RpcRequest` into a Task. This can be useful if you want to chain multiple requests but are only\ninterested in the end result.\n","type":"Grpc.RpcRequest req res -> Task.Task Grpc.Error res"},{"name":"withRisk","comment":" Make the request \"risky\" (i.e. \"withCredentials=true\" in javascript). This allows Set-Cookie to function in gRPC responses.\n","type":"Grpc.InternalRpcRequest req res usesTracker -> Grpc.InternalRpcRequest req res usesTracker"}],"binops":[]},{"name":"Grpc.Internal","comment":" Internals that are intended to be used from code generators.\n\n\n# Rpc representation\n\n@docs Rpc\n\n","unions":[{"name":"Rpc","comment":" Given the following proto file\n\n    \"\"\"\n    syntax = \"proto3\";\n\n    package helloworld;\n\n    service Greeter {\n      rpc SayHello (HelloRequest) returns (HelloReply) {}\n    }\n\n    message HelloRequest {\n      string name = 1;\n    }\n\n    message HelloReply {\n      string message = 1;\n    }\n    \"\"\"\n\nthe corresponding Rpc instance would be\n\n    Rpc\n        { service = \"Greeter\"\n        , package = \"helloworld\"\n        , rpcName = \"SayHello\"\n        , encoder = helloRequestEncoder\n        , decoder = helloReplyDecoder\n        }\n\nwhere `helloRequestEncoder` and `helloReplyDecoder` are Encoders/Decoders built with `elm-protocol-buffers`.\n\n","args":["req","res"],"cases":[["Rpc",["{ service : String.String, package : String.String, rpcName : String.String, encoder : req -> Protobuf.Encode.Encoder, decoder : Protobuf.Decode.Decoder res }"]]]}],"aliases":[],"values":[],"binops":[]}]