Siftsciex v0.3.1 Siftsciex.Score.Response View Source
Represents a Score API response
Link to this section Summary
Functions
Processes a response body and converts it into a Siftsciex.Score.Response.t/0
struct
Link to this section Types
Link to this type
t()
View Source
t() :: %Siftsciex.Score.Response{ error_message: :empty | String.t(), latest_labels: :empty | [Siftsciex.Score.Response.Label.t()], scores: :empty | [Siftsciex.Score.Response.Score.t()], status: :empty | integer(), user_id: :empty | String.t() }
Link to this section Functions
Link to this function
process(body)
View Source
process(String.t() | map()) :: Siftsciex.Score.Response.t()
Processes a response body and converts it into a Siftsciex.Score.Response.t/0
struct.
Parameters
body
: AString.t
representation of a Sift Science Score Response
Examples
iex> Response.process("{\"status\":0,\"error_message\":\"OK\",\"user_id\":\"bob\",\"scores\":{\"payment_abuse\":{\"score\":0.3}}}")
%Response{status: 0, error_message: "OK", user_id: "bob", scores: [%Siftsciex.Score.Response.Score{type: :payment_abuse, score: 0.3}]}