{-# 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.CustomerProfiles.Types.MatchingResponse
-- 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.CustomerProfiles.Types.MatchingResponse where

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

-- | The flag that enables the matching process of duplicate profiles.
--
-- /See:/ 'newMatchingResponse' smart constructor.
data MatchingResponse = MatchingResponse'
  { -- | The flag that enables the matching process of duplicate profiles.
    MatchingResponse -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (MatchingResponse -> MatchingResponse -> Bool
(MatchingResponse -> MatchingResponse -> Bool)
-> (MatchingResponse -> MatchingResponse -> Bool)
-> Eq MatchingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MatchingResponse -> MatchingResponse -> Bool
$c/= :: MatchingResponse -> MatchingResponse -> Bool
== :: MatchingResponse -> MatchingResponse -> Bool
$c== :: MatchingResponse -> MatchingResponse -> Bool
Prelude.Eq, ReadPrec [MatchingResponse]
ReadPrec MatchingResponse
Int -> ReadS MatchingResponse
ReadS [MatchingResponse]
(Int -> ReadS MatchingResponse)
-> ReadS [MatchingResponse]
-> ReadPrec MatchingResponse
-> ReadPrec [MatchingResponse]
-> Read MatchingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MatchingResponse]
$creadListPrec :: ReadPrec [MatchingResponse]
readPrec :: ReadPrec MatchingResponse
$creadPrec :: ReadPrec MatchingResponse
readList :: ReadS [MatchingResponse]
$creadList :: ReadS [MatchingResponse]
readsPrec :: Int -> ReadS MatchingResponse
$creadsPrec :: Int -> ReadS MatchingResponse
Prelude.Read, Int -> MatchingResponse -> ShowS
[MatchingResponse] -> ShowS
MatchingResponse -> String
(Int -> MatchingResponse -> ShowS)
-> (MatchingResponse -> String)
-> ([MatchingResponse] -> ShowS)
-> Show MatchingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MatchingResponse] -> ShowS
$cshowList :: [MatchingResponse] -> ShowS
show :: MatchingResponse -> String
$cshow :: MatchingResponse -> String
showsPrec :: Int -> MatchingResponse -> ShowS
$cshowsPrec :: Int -> MatchingResponse -> ShowS
Prelude.Show, (forall x. MatchingResponse -> Rep MatchingResponse x)
-> (forall x. Rep MatchingResponse x -> MatchingResponse)
-> Generic MatchingResponse
forall x. Rep MatchingResponse x -> MatchingResponse
forall x. MatchingResponse -> Rep MatchingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MatchingResponse x -> MatchingResponse
$cfrom :: forall x. MatchingResponse -> Rep MatchingResponse x
Prelude.Generic)

-- |
-- Create a value of 'MatchingResponse' 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:
--
-- 'enabled', 'matchingResponse_enabled' - The flag that enables the matching process of duplicate profiles.
newMatchingResponse ::
  MatchingResponse
newMatchingResponse :: MatchingResponse
newMatchingResponse =
  MatchingResponse' :: Maybe Bool -> MatchingResponse
MatchingResponse' {$sel:enabled:MatchingResponse' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing}

-- | The flag that enables the matching process of duplicate profiles.
matchingResponse_enabled :: Lens.Lens' MatchingResponse (Prelude.Maybe Prelude.Bool)
matchingResponse_enabled :: (Maybe Bool -> f (Maybe Bool))
-> MatchingResponse -> f MatchingResponse
matchingResponse_enabled = (MatchingResponse -> Maybe Bool)
-> (MatchingResponse -> Maybe Bool -> MatchingResponse)
-> Lens MatchingResponse MatchingResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingResponse' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:MatchingResponse' :: MatchingResponse -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: MatchingResponse
s@MatchingResponse' {} Maybe Bool
a -> MatchingResponse
s {$sel:enabled:MatchingResponse' :: Maybe Bool
enabled = Maybe Bool
a} :: MatchingResponse)

instance Core.FromJSON MatchingResponse where
  parseJSON :: Value -> Parser MatchingResponse
parseJSON =
    String
-> (Object -> Parser MatchingResponse)
-> Value
-> Parser MatchingResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MatchingResponse"
      ( \Object
x ->
          Maybe Bool -> MatchingResponse
MatchingResponse' (Maybe Bool -> MatchingResponse)
-> Parser (Maybe Bool) -> Parser MatchingResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
      )

instance Prelude.Hashable MatchingResponse

instance Prelude.NFData MatchingResponse