Domo.ensure_type_ok

You're seeing just the callback ensure_type_ok, go back to Domo module for more information.

Specs

ensure_type_ok(struct :: struct()) :: {:ok, struct()} | {:error, any()}
Link to this callback

ensure_type_ok(struct, opts)

View Source

Specs

ensure_type_ok(struct :: struct(), opts :: keyword()) ::
  {:ok, struct()} | {:error, any()}

Ensures that struct conforms to its t() type and all preconditions are fulfilled.

Returns struct when it's valid in the shape of {:ok, struct}. Otherwise returns the error in the shape of {:error, message_by_field}.

Useful for struct validation when its fields changed with map syntax or with Map module functions.