Siftsciex v0.3.1 Siftsciex.Event.Response View Source
Module for handling a Sift Science Event response
Link to this section Summary
Functions
Returns the error type (t:Siftsciex.Event.Response.Error.value/0
) of the response if the response indicates an error
Determines whether the given Response struct reflects an error
Processes the respose from Sift Science
Link to this section Types
Link to this type
t()
View Source
t() :: %Siftsciex.Event.Response{ message: Siftsciex.Event.Payload.payload_string(), request: Siftsciex.Event.Payload.payload_string(), score_response: :empty | Siftsciex.Score.Response.t(), status: Siftsciex.Event.Payload.payload_int(), time: :empty | DateTime.t() }
Link to this section Functions
Link to this function
error(response)
View Source
error(Siftsciex.Event.Response.t()) :: Siftsciex.Event.Response.Error.value()
Returns the error type (t:Siftsciex.Event.Response.Error.value/0
) of the response if the response indicates an error.
Parameters
response
: The respnonse object to check the error for.
Examples
iex> Response.error(%Response{status: 51})
:invalid_api_key
Link to this function
error?(response)
View Source
error?(Siftsciex.Event.Response.t()) :: boolean()
Determines whether the given Response struct reflects an error.
Parameters
response
: TheSiftsciex.Event.Response.t/0
struct to check
Examples
iex> Response.error?(%Response{status: 51})
true
iex> Response.error?(%Response{status: 0})
false