exhal v7.1.1 ExHal.Form

Represents a Dwolla style HAL form. Generally these are acquired from ExHal.Document.get_form/2, ExHal.Document.fetch_form/2, etc

Link to this section Summary

Types

t()

A form that can be completed and submitted. This type is opaque and should only be used as an argument to functions in this, Elixir.ExHal.Form module

Functions

Creates a new form from raw form JSON

Returns list of the fields in this form

Returns form with the specified fields value updated

Submits form and returns the response

Link to this section Types

A form that can be completed and submitted. This type is opaque and should only be used as an argument to functions in this, Elixir.ExHal.Form module.

Link to this section Functions

Link to this function client_module()
Link to this function from_forms_entry(a_map)
from_forms_entry(%{}) :: ExHal.Form.t

Creates a new form from raw form JSON.

Raises ArgumentError if a_map is not a valid form fragment.

Link to this function get_fields(a_form)
get_fields(ExHal.Form.t) :: [ExHal.FormField.t]

Returns list of the fields in this form.

Link to this function set_field_value(form, field_name, new_value)

Returns form with the specified fields value updated.

Raises ArgumentError if the specified field doesn’t exist.

Link to this function submit(form, client)
submit(ExHal.Form.t, Client.t) :: Client.http_response

Submits form and returns the response.