View Source FLHook.Params (FLHook Client v1.0.0)
A module that provides helpers to decode command response and event params.
Link to this section Summary
Functions
Fetches a param as boolean from the params collection. Raises when the param is missing or could not be coerced.
Fetches a param as duration from the params collection. Raises when the param is missing or could not be coerced.
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to.
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to. Raises when the param is missing or could not be coerced to the given type.
Fetches a param as float from the params collection. Raises when the param is missing or could not be coerced.
Fetches a param as integer from the params collection. Raises when the param is missing or could not be coerced.
Fetches multiple params with the specified keys from the params collection. Optionally allows specification of a type to coerce the param to.
Puts multiple params with the specified keys from the params collection in the given struct. Optionally allows specification of a type to coerce the param to.
Fetches a param as string from the params collection. Raises when the param is missing or could not be coerced.
Converts the params to a plain map.
Link to this section Types
Link to this section Functions
Specs
Fetches a param as boolean from the params collection. Raises when the param is missing or could not be coerced.
Specs
duration!(t(), key()) :: FLHook.Duration.t() | no_return()
Fetches a param as duration from the params collection. Raises when the param is missing or could not be coerced.
Specs
fetch(t(), key(), param_type()) :: {:ok, any()} | {:error, FLHook.ParamError.t()}
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to.
Specs
fetch!(t(), key(), param_type()) :: any() | no_return()
Fetches the param with the specified key from the params collection. Optionally allows specification of a type to coerce the param to. Raises when the param is missing or could not be coerced to the given type.
Specs
Fetches a param as float from the params collection. Raises when the param is missing or could not be coerced.
Specs
Fetches a param as integer from the params collection. Raises when the param is missing or could not be coerced.
Specs
pick(t(), [key()] | [{key(), param_type()}]) :: {:ok, %{optional(key()) => any()}} | {:error, FLHook.ParamError.t()}
Fetches multiple params with the specified keys from the params collection. Optionally allows specification of a type to coerce the param to.
Specs
pick_into(t(), module() | struct(), [key()] | [{key(), param_type()}]) :: {:ok, struct()} | {:error, FLHook.ParamError.t()}
Puts multiple params with the specified keys from the params collection in the given struct. Optionally allows specification of a type to coerce the param to.
Specs
Fetches a param as string from the params collection. Raises when the param is missing or could not be coerced.
Specs
Converts the params to a plain map.