The Googleapis for Elixir project provides generated Elixir modules for Google APIs, built from official Google Protocol Buffers definitions.
It is designed to be used in conjunction with Elixir gRPC and protobuf, enabling seamless interaction with Google services through idiomatic Elixir code.
- Generated Elixir modules for multiple Google APIs
- Fully compatible with the
protobufElixir library - Ideal for use with
grpcclients and servers - Maintained as part of the Elixir gRPC ecosystem
- Licensed under Apache 2.0
Add googleapis to your list of dependencies in mix.exs:
def deps do
[
{:googleapis, "~> 0.1.0"}
]
endThis package contains auto-generated modules based on Google's .proto definitions. You can use these modules directly to encode/decode protobuf messages or to interact with Google APIs using gRPC.
Example (for illustrative purposes only):
alias Google.Rpc.Status
# Create a new Status struct
status = %Status{
code: 404,
message: "Resource not found",
details: []
}
# Encode the struct into a protobuf binary
encoded = Status.encode(status)
# Decode the binary back into a struct
decoded = Status.decode(encoded)
IO.inspect(decoded, label: "Decoded Status")The
Statusmessage is part of Google’s standard RPC error model. It defines a logical error schema that is used by gRPC and REST APIs, containing an error code, message, and optional structured details. More information: Google API Design Guide
This package depends on:
-
protobuf — for Protocol Buffers encoding/decoding
-
ex_doc — for documentation generation (development only)