google_gax v0.1.1 GoogleApi.Gax.ModelBase View Source

This module helps you quickly and concisely define API models.

Example:

defmodule Pet do
  use GoogleApi.Gax.ModelBase

  field(:id)
  field(:category, as: Category)
  field(:tags, as: Tag, type: :list)
end

Link to this section Summary

Functions

Helper to decode model fields

Helper to encode model into JSON

Link to this section Functions

Link to this function decode(value, arg2, module) View Source
decode(struct(), :list | :map | :primitive, nil | module()) :: struct()

Helper to decode model fields

Link to this function encode(value, options) View Source
encode(struct(), keyword()) :: String.t()

Helper to encode model into JSON

Link to this macro field(field_name, opts \\ []) View Source (macro)