{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.FraudDetector.Types.VariableEntry
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.FraudDetector.Types.VariableEntry where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A variable in the list of variables for the batch create variable
-- request.
--
-- /See:/ 'newVariableEntry' smart constructor.
data VariableEntry = VariableEntry'
  { -- | The name of the variable.
    VariableEntry -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The data source of the variable.
    VariableEntry -> Maybe Text
dataSource :: Prelude.Maybe Prelude.Text,
    -- | The data type of the variable.
    VariableEntry -> Maybe Text
dataType :: Prelude.Maybe Prelude.Text,
    -- | The default value of the variable.
    VariableEntry -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text,
    -- | The type of the variable. For more information see
    -- <https://docs.aws.amazon.com/frauddetector/latest/ug/create-a-variable.html#variable-types Variable types>.
    --
    -- Valid Values:
    -- @AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT @
    VariableEntry -> Maybe Text
variableType :: Prelude.Maybe Prelude.Text,
    -- | The description of the variable.
    VariableEntry -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (VariableEntry -> VariableEntry -> Bool
(VariableEntry -> VariableEntry -> Bool)
-> (VariableEntry -> VariableEntry -> Bool) -> Eq VariableEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VariableEntry -> VariableEntry -> Bool
$c/= :: VariableEntry -> VariableEntry -> Bool
== :: VariableEntry -> VariableEntry -> Bool
$c== :: VariableEntry -> VariableEntry -> Bool
Prelude.Eq, ReadPrec [VariableEntry]
ReadPrec VariableEntry
Int -> ReadS VariableEntry
ReadS [VariableEntry]
(Int -> ReadS VariableEntry)
-> ReadS [VariableEntry]
-> ReadPrec VariableEntry
-> ReadPrec [VariableEntry]
-> Read VariableEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VariableEntry]
$creadListPrec :: ReadPrec [VariableEntry]
readPrec :: ReadPrec VariableEntry
$creadPrec :: ReadPrec VariableEntry
readList :: ReadS [VariableEntry]
$creadList :: ReadS [VariableEntry]
readsPrec :: Int -> ReadS VariableEntry
$creadsPrec :: Int -> ReadS VariableEntry
Prelude.Read, Int -> VariableEntry -> ShowS
[VariableEntry] -> ShowS
VariableEntry -> String
(Int -> VariableEntry -> ShowS)
-> (VariableEntry -> String)
-> ([VariableEntry] -> ShowS)
-> Show VariableEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VariableEntry] -> ShowS
$cshowList :: [VariableEntry] -> ShowS
show :: VariableEntry -> String
$cshow :: VariableEntry -> String
showsPrec :: Int -> VariableEntry -> ShowS
$cshowsPrec :: Int -> VariableEntry -> ShowS
Prelude.Show, (forall x. VariableEntry -> Rep VariableEntry x)
-> (forall x. Rep VariableEntry x -> VariableEntry)
-> Generic VariableEntry
forall x. Rep VariableEntry x -> VariableEntry
forall x. VariableEntry -> Rep VariableEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VariableEntry x -> VariableEntry
$cfrom :: forall x. VariableEntry -> Rep VariableEntry x
Prelude.Generic)

-- |
-- Create a value of 'VariableEntry' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'name', 'variableEntry_name' - The name of the variable.
--
-- 'dataSource', 'variableEntry_dataSource' - The data source of the variable.
--
-- 'dataType', 'variableEntry_dataType' - The data type of the variable.
--
-- 'defaultValue', 'variableEntry_defaultValue' - The default value of the variable.
--
-- 'variableType', 'variableEntry_variableType' - The type of the variable. For more information see
-- <https://docs.aws.amazon.com/frauddetector/latest/ug/create-a-variable.html#variable-types Variable types>.
--
-- Valid Values:
-- @AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT @
--
-- 'description', 'variableEntry_description' - The description of the variable.
newVariableEntry ::
  VariableEntry
newVariableEntry :: VariableEntry
newVariableEntry =
  VariableEntry' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> VariableEntry
VariableEntry'
    { $sel:name:VariableEntry' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSource:VariableEntry' :: Maybe Text
dataSource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataType:VariableEntry' :: Maybe Text
dataType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultValue:VariableEntry' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:variableType:VariableEntry' :: Maybe Text
variableType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:VariableEntry' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the variable.
variableEntry_name :: Lens.Lens' VariableEntry (Prelude.Maybe Prelude.Text)
variableEntry_name :: (Maybe Text -> f (Maybe Text)) -> VariableEntry -> f VariableEntry
variableEntry_name = (VariableEntry -> Maybe Text)
-> (VariableEntry -> Maybe Text -> VariableEntry)
-> Lens VariableEntry VariableEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VariableEntry' {Maybe Text
name :: Maybe Text
$sel:name:VariableEntry' :: VariableEntry -> Maybe Text
name} -> Maybe Text
name) (\s :: VariableEntry
s@VariableEntry' {} Maybe Text
a -> VariableEntry
s {$sel:name:VariableEntry' :: Maybe Text
name = Maybe Text
a} :: VariableEntry)

-- | The data source of the variable.
variableEntry_dataSource :: Lens.Lens' VariableEntry (Prelude.Maybe Prelude.Text)
variableEntry_dataSource :: (Maybe Text -> f (Maybe Text)) -> VariableEntry -> f VariableEntry
variableEntry_dataSource = (VariableEntry -> Maybe Text)
-> (VariableEntry -> Maybe Text -> VariableEntry)
-> Lens VariableEntry VariableEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VariableEntry' {Maybe Text
dataSource :: Maybe Text
$sel:dataSource:VariableEntry' :: VariableEntry -> Maybe Text
dataSource} -> Maybe Text
dataSource) (\s :: VariableEntry
s@VariableEntry' {} Maybe Text
a -> VariableEntry
s {$sel:dataSource:VariableEntry' :: Maybe Text
dataSource = Maybe Text
a} :: VariableEntry)

-- | The data type of the variable.
variableEntry_dataType :: Lens.Lens' VariableEntry (Prelude.Maybe Prelude.Text)
variableEntry_dataType :: (Maybe Text -> f (Maybe Text)) -> VariableEntry -> f VariableEntry
variableEntry_dataType = (VariableEntry -> Maybe Text)
-> (VariableEntry -> Maybe Text -> VariableEntry)
-> Lens VariableEntry VariableEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VariableEntry' {Maybe Text
dataType :: Maybe Text
$sel:dataType:VariableEntry' :: VariableEntry -> Maybe Text
dataType} -> Maybe Text
dataType) (\s :: VariableEntry
s@VariableEntry' {} Maybe Text
a -> VariableEntry
s {$sel:dataType:VariableEntry' :: Maybe Text
dataType = Maybe Text
a} :: VariableEntry)

-- | The default value of the variable.
variableEntry_defaultValue :: Lens.Lens' VariableEntry (Prelude.Maybe Prelude.Text)
variableEntry_defaultValue :: (Maybe Text -> f (Maybe Text)) -> VariableEntry -> f VariableEntry
variableEntry_defaultValue = (VariableEntry -> Maybe Text)
-> (VariableEntry -> Maybe Text -> VariableEntry)
-> Lens VariableEntry VariableEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VariableEntry' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:VariableEntry' :: VariableEntry -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: VariableEntry
s@VariableEntry' {} Maybe Text
a -> VariableEntry
s {$sel:defaultValue:VariableEntry' :: Maybe Text
defaultValue = Maybe Text
a} :: VariableEntry)

-- | The type of the variable. For more information see
-- <https://docs.aws.amazon.com/frauddetector/latest/ug/create-a-variable.html#variable-types Variable types>.
--
-- Valid Values:
-- @AUTH_CODE | AVS | BILLING_ADDRESS_L1 | BILLING_ADDRESS_L2 | BILLING_CITY | BILLING_COUNTRY | BILLING_NAME | BILLING_PHONE | BILLING_STATE | BILLING_ZIP | CARD_BIN | CATEGORICAL | CURRENCY_CODE | EMAIL_ADDRESS | FINGERPRINT | FRAUD_LABEL | FREE_FORM_TEXT | IP_ADDRESS | NUMERIC | ORDER_ID | PAYMENT_TYPE | PHONE_NUMBER | PRICE | PRODUCT_CATEGORY | SHIPPING_ADDRESS_L1 | SHIPPING_ADDRESS_L2 | SHIPPING_CITY | SHIPPING_COUNTRY | SHIPPING_NAME | SHIPPING_PHONE | SHIPPING_STATE | SHIPPING_ZIP | USERAGENT @
variableEntry_variableType :: Lens.Lens' VariableEntry (Prelude.Maybe Prelude.Text)
variableEntry_variableType :: (Maybe Text -> f (Maybe Text)) -> VariableEntry -> f VariableEntry
variableEntry_variableType = (VariableEntry -> Maybe Text)
-> (VariableEntry -> Maybe Text -> VariableEntry)
-> Lens VariableEntry VariableEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VariableEntry' {Maybe Text
variableType :: Maybe Text
$sel:variableType:VariableEntry' :: VariableEntry -> Maybe Text
variableType} -> Maybe Text
variableType) (\s :: VariableEntry
s@VariableEntry' {} Maybe Text
a -> VariableEntry
s {$sel:variableType:VariableEntry' :: Maybe Text
variableType = Maybe Text
a} :: VariableEntry)

-- | The description of the variable.
variableEntry_description :: Lens.Lens' VariableEntry (Prelude.Maybe Prelude.Text)
variableEntry_description :: (Maybe Text -> f (Maybe Text)) -> VariableEntry -> f VariableEntry
variableEntry_description = (VariableEntry -> Maybe Text)
-> (VariableEntry -> Maybe Text -> VariableEntry)
-> Lens VariableEntry VariableEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VariableEntry' {Maybe Text
description :: Maybe Text
$sel:description:VariableEntry' :: VariableEntry -> Maybe Text
description} -> Maybe Text
description) (\s :: VariableEntry
s@VariableEntry' {} Maybe Text
a -> VariableEntry
s {$sel:description:VariableEntry' :: Maybe Text
description = Maybe Text
a} :: VariableEntry)

instance Prelude.Hashable VariableEntry

instance Prelude.NFData VariableEntry

instance Core.ToJSON VariableEntry where
  toJSON :: VariableEntry -> Value
toJSON VariableEntry' {Maybe Text
description :: Maybe Text
variableType :: Maybe Text
defaultValue :: Maybe Text
dataType :: Maybe Text
dataSource :: Maybe Text
name :: Maybe Text
$sel:description:VariableEntry' :: VariableEntry -> Maybe Text
$sel:variableType:VariableEntry' :: VariableEntry -> Maybe Text
$sel:defaultValue:VariableEntry' :: VariableEntry -> Maybe Text
$sel:dataType:VariableEntry' :: VariableEntry -> Maybe Text
$sel:dataSource:VariableEntry' :: VariableEntry -> Maybe Text
$sel:name:VariableEntry' :: VariableEntry -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"dataSource" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dataSource,
            (Text
"dataType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dataType,
            (Text
"defaultValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
defaultValue,
            (Text
"variableType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
variableType,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
          ]
      )