Siftsciex v0.3.1 Siftsciex.Score.Response.Reason View Source
Represents a reason for a Sift Score
Link to this section Summary
Link to this section Types
Link to this section Functions
Link to this function
new(data)
View Source
new(data() | [data()]) :: Siftsciex.Score.Response.Reason.t()
Creates a new t:Siftscience.Score.Response.Reason.t/0
struct from a response
Parameters
data
: A single or list of maps to be turned into structs
Examples
iex> Reason.new(%{name: "Bob", value: "Fraudster", details: %{"users" => "a, b, c"}})
%Reason{name: "Bob", value: "Fraudster", details: %{"users" => "a, b, c"}}
iex> Reason.new(%{name: "Bob", value: "Fraudster", details: "fake stuff"})
%Reason{name: "Bob", value: "Fraudster", details: "fake stuff"}
iex> Reason.new(%{name: "Bob", value: "Fraudster"})
%Reason{name: "Bob", value: "Fraudster", details: :empty}
iex> Reason.new([%{name: "Bob", value: "Fraudster"}, %{name: "Sue", value: "Criminal"}])
[%Reason{name: "Bob", value: "Fraudster"}, %Reason{name: "Sue", value: "Criminal"}]