Skip to main content

README.md

# googly_cloud_storage

Google Cloud Storage JSON API client library. Stores and retrieves potentially large, immutable data objects.

A modern, self-contained Elixir client for the Google Cloud Storage JSON API, generated by
[googly](https://github.com/). Built on [Req](https://hex.pm/packages/req) and
[Jason](https://hex.pm/packages/jason).

## Installation

```elixir
def deps do
  [{:googly_cloud_storage, "~> 0.1.0"}]
end
```

## Usage

Authentication is your concern — pass an OAuth2 bearer token (e.g. from
[Goth](https://hex.pm/packages/goth)) via the `:token` option:

```elixir
token = Goth.fetch!(MyApp.Goth).token

{:ok, result} = Googly.CloudStorage.Objects.bulk_restore(token: token)
```

Every call returns `{:ok, decoded}` on success. Failures are
`{:error, %Googly.CloudStorage.Error{}}` for an error *response* (HTTP 4xx/5xx), or
`{:error, exception}` (e.g. `%Req.TransportError{}`) for transport-level failures.

## Docs

* [Upstream API reference](https://developers.google.com/storage/docs/json_api/)