{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CustomerProfiles.Types.MatchingResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CustomerProfiles.Types.AutoMerging
import Amazonka.CustomerProfiles.Types.ExportingConfig
import Amazonka.CustomerProfiles.Types.JobSchedule
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The flag that enables the matching process of duplicate profiles.
--
-- /See:/ 'newMatchingResponse' smart constructor.
data MatchingResponse = MatchingResponse'
  { -- | Configuration information about the auto-merging process.
    MatchingResponse -> Maybe AutoMerging
autoMerging :: Prelude.Maybe AutoMerging,
    -- | The flag that enables the matching process of duplicate profiles.
    MatchingResponse -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | Configuration information for exporting Identity Resolution results, for
    -- example, to an S3 bucket.
    MatchingResponse -> Maybe ExportingConfig
exportingConfig :: Prelude.Maybe ExportingConfig,
    -- | The day and time when do you want to start the Identity Resolution Job
    -- every week.
    MatchingResponse -> Maybe JobSchedule
jobSchedule :: Prelude.Maybe JobSchedule
  }
  deriving (MatchingResponse -> MatchingResponse -> Bool
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]
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
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. 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:
--
-- 'autoMerging', 'matchingResponse_autoMerging' - Configuration information about the auto-merging process.
--
-- 'enabled', 'matchingResponse_enabled' - The flag that enables the matching process of duplicate profiles.
--
-- 'exportingConfig', 'matchingResponse_exportingConfig' - Configuration information for exporting Identity Resolution results, for
-- example, to an S3 bucket.
--
-- 'jobSchedule', 'matchingResponse_jobSchedule' - The day and time when do you want to start the Identity Resolution Job
-- every week.
newMatchingResponse ::
  MatchingResponse
newMatchingResponse :: MatchingResponse
newMatchingResponse =
  MatchingResponse'
    { $sel:autoMerging:MatchingResponse' :: Maybe AutoMerging
autoMerging = forall a. Maybe a
Prelude.Nothing,
      $sel:enabled:MatchingResponse' :: Maybe Bool
enabled = forall a. Maybe a
Prelude.Nothing,
      $sel:exportingConfig:MatchingResponse' :: Maybe ExportingConfig
exportingConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:jobSchedule:MatchingResponse' :: Maybe JobSchedule
jobSchedule = forall a. Maybe a
Prelude.Nothing
    }

-- | Configuration information about the auto-merging process.
matchingResponse_autoMerging :: Lens.Lens' MatchingResponse (Prelude.Maybe AutoMerging)
matchingResponse_autoMerging :: Lens' MatchingResponse (Maybe AutoMerging)
matchingResponse_autoMerging = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingResponse' {Maybe AutoMerging
autoMerging :: Maybe AutoMerging
$sel:autoMerging:MatchingResponse' :: MatchingResponse -> Maybe AutoMerging
autoMerging} -> Maybe AutoMerging
autoMerging) (\s :: MatchingResponse
s@MatchingResponse' {} Maybe AutoMerging
a -> MatchingResponse
s {$sel:autoMerging:MatchingResponse' :: Maybe AutoMerging
autoMerging = Maybe AutoMerging
a} :: MatchingResponse)

-- | The flag that enables the matching process of duplicate profiles.
matchingResponse_enabled :: Lens.Lens' MatchingResponse (Prelude.Maybe Prelude.Bool)
matchingResponse_enabled :: Lens' MatchingResponse (Maybe Bool)
matchingResponse_enabled = 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)

-- | Configuration information for exporting Identity Resolution results, for
-- example, to an S3 bucket.
matchingResponse_exportingConfig :: Lens.Lens' MatchingResponse (Prelude.Maybe ExportingConfig)
matchingResponse_exportingConfig :: Lens' MatchingResponse (Maybe ExportingConfig)
matchingResponse_exportingConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingResponse' {Maybe ExportingConfig
exportingConfig :: Maybe ExportingConfig
$sel:exportingConfig:MatchingResponse' :: MatchingResponse -> Maybe ExportingConfig
exportingConfig} -> Maybe ExportingConfig
exportingConfig) (\s :: MatchingResponse
s@MatchingResponse' {} Maybe ExportingConfig
a -> MatchingResponse
s {$sel:exportingConfig:MatchingResponse' :: Maybe ExportingConfig
exportingConfig = Maybe ExportingConfig
a} :: MatchingResponse)

-- | The day and time when do you want to start the Identity Resolution Job
-- every week.
matchingResponse_jobSchedule :: Lens.Lens' MatchingResponse (Prelude.Maybe JobSchedule)
matchingResponse_jobSchedule :: Lens' MatchingResponse (Maybe JobSchedule)
matchingResponse_jobSchedule = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingResponse' {Maybe JobSchedule
jobSchedule :: Maybe JobSchedule
$sel:jobSchedule:MatchingResponse' :: MatchingResponse -> Maybe JobSchedule
jobSchedule} -> Maybe JobSchedule
jobSchedule) (\s :: MatchingResponse
s@MatchingResponse' {} Maybe JobSchedule
a -> MatchingResponse
s {$sel:jobSchedule:MatchingResponse' :: Maybe JobSchedule
jobSchedule = Maybe JobSchedule
a} :: MatchingResponse)

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

instance Prelude.Hashable MatchingResponse where
  hashWithSalt :: Int -> MatchingResponse -> Int
hashWithSalt Int
_salt MatchingResponse' {Maybe Bool
Maybe AutoMerging
Maybe JobSchedule
Maybe ExportingConfig
jobSchedule :: Maybe JobSchedule
exportingConfig :: Maybe ExportingConfig
enabled :: Maybe Bool
autoMerging :: Maybe AutoMerging
$sel:jobSchedule:MatchingResponse' :: MatchingResponse -> Maybe JobSchedule
$sel:exportingConfig:MatchingResponse' :: MatchingResponse -> Maybe ExportingConfig
$sel:enabled:MatchingResponse' :: MatchingResponse -> Maybe Bool
$sel:autoMerging:MatchingResponse' :: MatchingResponse -> Maybe AutoMerging
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AutoMerging
autoMerging
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExportingConfig
exportingConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobSchedule
jobSchedule

instance Prelude.NFData MatchingResponse where
  rnf :: MatchingResponse -> ()
rnf MatchingResponse' {Maybe Bool
Maybe AutoMerging
Maybe JobSchedule
Maybe ExportingConfig
jobSchedule :: Maybe JobSchedule
exportingConfig :: Maybe ExportingConfig
enabled :: Maybe Bool
autoMerging :: Maybe AutoMerging
$sel:jobSchedule:MatchingResponse' :: MatchingResponse -> Maybe JobSchedule
$sel:exportingConfig:MatchingResponse' :: MatchingResponse -> Maybe ExportingConfig
$sel:enabled:MatchingResponse' :: MatchingResponse -> Maybe Bool
$sel:autoMerging:MatchingResponse' :: MatchingResponse -> Maybe AutoMerging
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AutoMerging
autoMerging
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExportingConfig
exportingConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobSchedule
jobSchedule