Wax.Messages.Templates.Component (wax v1.1.4)
Template Components structure and management
Summary
Functions
Creats a new Body Component struct
Creats a new Button Component struct
Creats a new Header Component struct
Validates that the button parameters follow the rules and constraints of the Cloud API
Types
@type button_type() :: :catalog | :quick_reply | :url
@type component_type() :: :header | :body | :button
@type t() :: %Wax.Messages.Templates.Component{ index: 0..9, parameters: [Wax.Messages.Templates.Parameter.t()], sub_type: button_type(), type: component_type() }
Functions
@spec new_body([Wax.Messages.Templates.Parameter.t()]) :: t()
Creats a new Body Component struct
@spec new_button(button_type(), 0..9, [Wax.Messages.Templates.Parameter.t()]) :: t()
Creats a new Button Component struct
@spec new_header([Wax.Messages.Templates.Parameter.t()]) :: t()
Creats a new Header Component struct
@spec validate_button_params(button_type(), Keyword.t()) :: :ok | {:error, String.t()}
Validates that the button parameters follow the rules and constraints of the Cloud API