Googleapis for Elixir

Hex.pmBuild StatusLicense

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.


Features


Installation

Add googleapis to your list of dependencies in mix.exs:

def deps do
  [
    {:googleapis, "~> 0.1.0"}
  ]
end

Usage

This 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 Status message 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

Dependencies

This package depends on: