{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetAutoMergingPreview
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Tests the auto-merging settings of your Identity Resolution Job without
-- merging your data. It randomly selects a sample of matching groups from
-- the existing matching results, and applies the automerging settings that
-- you provided. You can then view the number of profiles in the sample,
-- the number of matches, and the number of profiles identified to be
-- merged. This enables you to evaluate the accuracy of the attributes in
-- your matching list.
--
-- You can\'t view which profiles are matched and would be merged.
--
-- We strongly recommend you use this API to do a dry run of the
-- automerging process before running the Identity Resolution Job. Include
-- __at least__ two matching attributes. If your matching list includes too
-- few attributes (such as only @FirstName@ or only @LastName@), there may
-- be a large number of matches. This increases the chances of erroneous
-- merges.
module Amazonka.CustomerProfiles.GetAutoMergingPreview
  ( -- * Creating a Request
    GetAutoMergingPreview (..),
    newGetAutoMergingPreview,

    -- * Request Lenses
    getAutoMergingPreview_minAllowedConfidenceScoreForMerging,
    getAutoMergingPreview_domainName,
    getAutoMergingPreview_consolidation,
    getAutoMergingPreview_conflictResolution,

    -- * Destructuring the Response
    GetAutoMergingPreviewResponse (..),
    newGetAutoMergingPreviewResponse,

    -- * Response Lenses
    getAutoMergingPreviewResponse_numberOfMatchesInSample,
    getAutoMergingPreviewResponse_numberOfProfilesInSample,
    getAutoMergingPreviewResponse_numberOfProfilesWillBeMerged,
    getAutoMergingPreviewResponse_httpStatus,
    getAutoMergingPreviewResponse_domainName,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CustomerProfiles.Types
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetAutoMergingPreview' smart constructor.
data GetAutoMergingPreview = GetAutoMergingPreview'
  { -- | Minimum confidence score required for profiles within a matching group
    -- to be merged during the auto-merge process.
    GetAutoMergingPreview -> Maybe Double
minAllowedConfidenceScoreForMerging :: Prelude.Maybe Prelude.Double,
    -- | The unique name of the domain.
    GetAutoMergingPreview -> Text
domainName :: Prelude.Text,
    -- | A list of matching attributes that represent matching criteria.
    GetAutoMergingPreview -> Consolidation
consolidation :: Consolidation,
    -- | How the auto-merging process should resolve conflicts between different
    -- profiles.
    GetAutoMergingPreview -> ConflictResolution
conflictResolution :: ConflictResolution
  }
  deriving (GetAutoMergingPreview -> GetAutoMergingPreview -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAutoMergingPreview -> GetAutoMergingPreview -> Bool
$c/= :: GetAutoMergingPreview -> GetAutoMergingPreview -> Bool
== :: GetAutoMergingPreview -> GetAutoMergingPreview -> Bool
$c== :: GetAutoMergingPreview -> GetAutoMergingPreview -> Bool
Prelude.Eq, ReadPrec [GetAutoMergingPreview]
ReadPrec GetAutoMergingPreview
Int -> ReadS GetAutoMergingPreview
ReadS [GetAutoMergingPreview]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAutoMergingPreview]
$creadListPrec :: ReadPrec [GetAutoMergingPreview]
readPrec :: ReadPrec GetAutoMergingPreview
$creadPrec :: ReadPrec GetAutoMergingPreview
readList :: ReadS [GetAutoMergingPreview]
$creadList :: ReadS [GetAutoMergingPreview]
readsPrec :: Int -> ReadS GetAutoMergingPreview
$creadsPrec :: Int -> ReadS GetAutoMergingPreview
Prelude.Read, Int -> GetAutoMergingPreview -> ShowS
[GetAutoMergingPreview] -> ShowS
GetAutoMergingPreview -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAutoMergingPreview] -> ShowS
$cshowList :: [GetAutoMergingPreview] -> ShowS
show :: GetAutoMergingPreview -> String
$cshow :: GetAutoMergingPreview -> String
showsPrec :: Int -> GetAutoMergingPreview -> ShowS
$cshowsPrec :: Int -> GetAutoMergingPreview -> ShowS
Prelude.Show, forall x. Rep GetAutoMergingPreview x -> GetAutoMergingPreview
forall x. GetAutoMergingPreview -> Rep GetAutoMergingPreview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAutoMergingPreview x -> GetAutoMergingPreview
$cfrom :: forall x. GetAutoMergingPreview -> Rep GetAutoMergingPreview x
Prelude.Generic)

-- |
-- Create a value of 'GetAutoMergingPreview' 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:
--
-- 'minAllowedConfidenceScoreForMerging', 'getAutoMergingPreview_minAllowedConfidenceScoreForMerging' - Minimum confidence score required for profiles within a matching group
-- to be merged during the auto-merge process.
--
-- 'domainName', 'getAutoMergingPreview_domainName' - The unique name of the domain.
--
-- 'consolidation', 'getAutoMergingPreview_consolidation' - A list of matching attributes that represent matching criteria.
--
-- 'conflictResolution', 'getAutoMergingPreview_conflictResolution' - How the auto-merging process should resolve conflicts between different
-- profiles.
newGetAutoMergingPreview ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'consolidation'
  Consolidation ->
  -- | 'conflictResolution'
  ConflictResolution ->
  GetAutoMergingPreview
newGetAutoMergingPreview :: Text
-> Consolidation -> ConflictResolution -> GetAutoMergingPreview
newGetAutoMergingPreview
  Text
pDomainName_
  Consolidation
pConsolidation_
  ConflictResolution
pConflictResolution_ =
    GetAutoMergingPreview'
      { $sel:minAllowedConfidenceScoreForMerging:GetAutoMergingPreview' :: Maybe Double
minAllowedConfidenceScoreForMerging =
          forall a. Maybe a
Prelude.Nothing,
        $sel:domainName:GetAutoMergingPreview' :: Text
domainName = Text
pDomainName_,
        $sel:consolidation:GetAutoMergingPreview' :: Consolidation
consolidation = Consolidation
pConsolidation_,
        $sel:conflictResolution:GetAutoMergingPreview' :: ConflictResolution
conflictResolution = ConflictResolution
pConflictResolution_
      }

-- | Minimum confidence score required for profiles within a matching group
-- to be merged during the auto-merge process.
getAutoMergingPreview_minAllowedConfidenceScoreForMerging :: Lens.Lens' GetAutoMergingPreview (Prelude.Maybe Prelude.Double)
getAutoMergingPreview_minAllowedConfidenceScoreForMerging :: Lens' GetAutoMergingPreview (Maybe Double)
getAutoMergingPreview_minAllowedConfidenceScoreForMerging = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreview' {Maybe Double
minAllowedConfidenceScoreForMerging :: Maybe Double
$sel:minAllowedConfidenceScoreForMerging:GetAutoMergingPreview' :: GetAutoMergingPreview -> Maybe Double
minAllowedConfidenceScoreForMerging} -> Maybe Double
minAllowedConfidenceScoreForMerging) (\s :: GetAutoMergingPreview
s@GetAutoMergingPreview' {} Maybe Double
a -> GetAutoMergingPreview
s {$sel:minAllowedConfidenceScoreForMerging:GetAutoMergingPreview' :: Maybe Double
minAllowedConfidenceScoreForMerging = Maybe Double
a} :: GetAutoMergingPreview)

-- | The unique name of the domain.
getAutoMergingPreview_domainName :: Lens.Lens' GetAutoMergingPreview Prelude.Text
getAutoMergingPreview_domainName :: Lens' GetAutoMergingPreview Text
getAutoMergingPreview_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreview' {Text
domainName :: Text
$sel:domainName:GetAutoMergingPreview' :: GetAutoMergingPreview -> Text
domainName} -> Text
domainName) (\s :: GetAutoMergingPreview
s@GetAutoMergingPreview' {} Text
a -> GetAutoMergingPreview
s {$sel:domainName:GetAutoMergingPreview' :: Text
domainName = Text
a} :: GetAutoMergingPreview)

-- | A list of matching attributes that represent matching criteria.
getAutoMergingPreview_consolidation :: Lens.Lens' GetAutoMergingPreview Consolidation
getAutoMergingPreview_consolidation :: Lens' GetAutoMergingPreview Consolidation
getAutoMergingPreview_consolidation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreview' {Consolidation
consolidation :: Consolidation
$sel:consolidation:GetAutoMergingPreview' :: GetAutoMergingPreview -> Consolidation
consolidation} -> Consolidation
consolidation) (\s :: GetAutoMergingPreview
s@GetAutoMergingPreview' {} Consolidation
a -> GetAutoMergingPreview
s {$sel:consolidation:GetAutoMergingPreview' :: Consolidation
consolidation = Consolidation
a} :: GetAutoMergingPreview)

-- | How the auto-merging process should resolve conflicts between different
-- profiles.
getAutoMergingPreview_conflictResolution :: Lens.Lens' GetAutoMergingPreview ConflictResolution
getAutoMergingPreview_conflictResolution :: Lens' GetAutoMergingPreview ConflictResolution
getAutoMergingPreview_conflictResolution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreview' {ConflictResolution
conflictResolution :: ConflictResolution
$sel:conflictResolution:GetAutoMergingPreview' :: GetAutoMergingPreview -> ConflictResolution
conflictResolution} -> ConflictResolution
conflictResolution) (\s :: GetAutoMergingPreview
s@GetAutoMergingPreview' {} ConflictResolution
a -> GetAutoMergingPreview
s {$sel:conflictResolution:GetAutoMergingPreview' :: ConflictResolution
conflictResolution = ConflictResolution
a} :: GetAutoMergingPreview)

instance Core.AWSRequest GetAutoMergingPreview where
  type
    AWSResponse GetAutoMergingPreview =
      GetAutoMergingPreviewResponse
  request :: (Service -> Service)
-> GetAutoMergingPreview -> Request GetAutoMergingPreview
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetAutoMergingPreview
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetAutoMergingPreview)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Int
-> Text
-> GetAutoMergingPreviewResponse
GetAutoMergingPreviewResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NumberOfMatchesInSample")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NumberOfProfilesInSample")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NumberOfProfilesWillBeMerged")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"DomainName")
      )

instance Prelude.Hashable GetAutoMergingPreview where
  hashWithSalt :: Int -> GetAutoMergingPreview -> Int
hashWithSalt Int
_salt GetAutoMergingPreview' {Maybe Double
Text
ConflictResolution
Consolidation
conflictResolution :: ConflictResolution
consolidation :: Consolidation
domainName :: Text
minAllowedConfidenceScoreForMerging :: Maybe Double
$sel:conflictResolution:GetAutoMergingPreview' :: GetAutoMergingPreview -> ConflictResolution
$sel:consolidation:GetAutoMergingPreview' :: GetAutoMergingPreview -> Consolidation
$sel:domainName:GetAutoMergingPreview' :: GetAutoMergingPreview -> Text
$sel:minAllowedConfidenceScoreForMerging:GetAutoMergingPreview' :: GetAutoMergingPreview -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
minAllowedConfidenceScoreForMerging
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Consolidation
consolidation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ConflictResolution
conflictResolution

instance Prelude.NFData GetAutoMergingPreview where
  rnf :: GetAutoMergingPreview -> ()
rnf GetAutoMergingPreview' {Maybe Double
Text
ConflictResolution
Consolidation
conflictResolution :: ConflictResolution
consolidation :: Consolidation
domainName :: Text
minAllowedConfidenceScoreForMerging :: Maybe Double
$sel:conflictResolution:GetAutoMergingPreview' :: GetAutoMergingPreview -> ConflictResolution
$sel:consolidation:GetAutoMergingPreview' :: GetAutoMergingPreview -> Consolidation
$sel:domainName:GetAutoMergingPreview' :: GetAutoMergingPreview -> Text
$sel:minAllowedConfidenceScoreForMerging:GetAutoMergingPreview' :: GetAutoMergingPreview -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
minAllowedConfidenceScoreForMerging
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domainName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Consolidation
consolidation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ConflictResolution
conflictResolution

instance Data.ToHeaders GetAutoMergingPreview where
  toHeaders :: GetAutoMergingPreview -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetAutoMergingPreview where
  toJSON :: GetAutoMergingPreview -> Value
toJSON GetAutoMergingPreview' {Maybe Double
Text
ConflictResolution
Consolidation
conflictResolution :: ConflictResolution
consolidation :: Consolidation
domainName :: Text
minAllowedConfidenceScoreForMerging :: Maybe Double
$sel:conflictResolution:GetAutoMergingPreview' :: GetAutoMergingPreview -> ConflictResolution
$sel:consolidation:GetAutoMergingPreview' :: GetAutoMergingPreview -> Consolidation
$sel:domainName:GetAutoMergingPreview' :: GetAutoMergingPreview -> Text
$sel:minAllowedConfidenceScoreForMerging:GetAutoMergingPreview' :: GetAutoMergingPreview -> Maybe Double
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MinAllowedConfidenceScoreForMerging" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
minAllowedConfidenceScoreForMerging,
            forall a. a -> Maybe a
Prelude.Just (Key
"Consolidation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Consolidation
consolidation),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ConflictResolution" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ConflictResolution
conflictResolution)
          ]
      )

instance Data.ToPath GetAutoMergingPreview where
  toPath :: GetAutoMergingPreview -> ByteString
toPath GetAutoMergingPreview' {Maybe Double
Text
ConflictResolution
Consolidation
conflictResolution :: ConflictResolution
consolidation :: Consolidation
domainName :: Text
minAllowedConfidenceScoreForMerging :: Maybe Double
$sel:conflictResolution:GetAutoMergingPreview' :: GetAutoMergingPreview -> ConflictResolution
$sel:consolidation:GetAutoMergingPreview' :: GetAutoMergingPreview -> Consolidation
$sel:domainName:GetAutoMergingPreview' :: GetAutoMergingPreview -> Text
$sel:minAllowedConfidenceScoreForMerging:GetAutoMergingPreview' :: GetAutoMergingPreview -> Maybe Double
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/domains/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
domainName,
        ByteString
"/identity-resolution-jobs/auto-merging-preview"
      ]

instance Data.ToQuery GetAutoMergingPreview where
  toQuery :: GetAutoMergingPreview -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetAutoMergingPreviewResponse' smart constructor.
data GetAutoMergingPreviewResponse = GetAutoMergingPreviewResponse'
  { -- | The number of match groups in the domain that have been reviewed in this
    -- preview dry run.
    GetAutoMergingPreviewResponse -> Maybe Integer
numberOfMatchesInSample :: Prelude.Maybe Prelude.Integer,
    -- | The number of profiles found in this preview dry run.
    GetAutoMergingPreviewResponse -> Maybe Integer
numberOfProfilesInSample :: Prelude.Maybe Prelude.Integer,
    -- | The number of profiles that would be merged if this wasn\'t a preview
    -- dry run.
    GetAutoMergingPreviewResponse -> Maybe Integer
numberOfProfilesWillBeMerged :: Prelude.Maybe Prelude.Integer,
    -- | The response's http status code.
    GetAutoMergingPreviewResponse -> Int
httpStatus :: Prelude.Int,
    -- | The unique name of the domain.
    GetAutoMergingPreviewResponse -> Text
domainName :: Prelude.Text
  }
  deriving (GetAutoMergingPreviewResponse
-> GetAutoMergingPreviewResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAutoMergingPreviewResponse
-> GetAutoMergingPreviewResponse -> Bool
$c/= :: GetAutoMergingPreviewResponse
-> GetAutoMergingPreviewResponse -> Bool
== :: GetAutoMergingPreviewResponse
-> GetAutoMergingPreviewResponse -> Bool
$c== :: GetAutoMergingPreviewResponse
-> GetAutoMergingPreviewResponse -> Bool
Prelude.Eq, ReadPrec [GetAutoMergingPreviewResponse]
ReadPrec GetAutoMergingPreviewResponse
Int -> ReadS GetAutoMergingPreviewResponse
ReadS [GetAutoMergingPreviewResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAutoMergingPreviewResponse]
$creadListPrec :: ReadPrec [GetAutoMergingPreviewResponse]
readPrec :: ReadPrec GetAutoMergingPreviewResponse
$creadPrec :: ReadPrec GetAutoMergingPreviewResponse
readList :: ReadS [GetAutoMergingPreviewResponse]
$creadList :: ReadS [GetAutoMergingPreviewResponse]
readsPrec :: Int -> ReadS GetAutoMergingPreviewResponse
$creadsPrec :: Int -> ReadS GetAutoMergingPreviewResponse
Prelude.Read, Int -> GetAutoMergingPreviewResponse -> ShowS
[GetAutoMergingPreviewResponse] -> ShowS
GetAutoMergingPreviewResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAutoMergingPreviewResponse] -> ShowS
$cshowList :: [GetAutoMergingPreviewResponse] -> ShowS
show :: GetAutoMergingPreviewResponse -> String
$cshow :: GetAutoMergingPreviewResponse -> String
showsPrec :: Int -> GetAutoMergingPreviewResponse -> ShowS
$cshowsPrec :: Int -> GetAutoMergingPreviewResponse -> ShowS
Prelude.Show, forall x.
Rep GetAutoMergingPreviewResponse x
-> GetAutoMergingPreviewResponse
forall x.
GetAutoMergingPreviewResponse
-> Rep GetAutoMergingPreviewResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAutoMergingPreviewResponse x
-> GetAutoMergingPreviewResponse
$cfrom :: forall x.
GetAutoMergingPreviewResponse
-> Rep GetAutoMergingPreviewResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAutoMergingPreviewResponse' 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:
--
-- 'numberOfMatchesInSample', 'getAutoMergingPreviewResponse_numberOfMatchesInSample' - The number of match groups in the domain that have been reviewed in this
-- preview dry run.
--
-- 'numberOfProfilesInSample', 'getAutoMergingPreviewResponse_numberOfProfilesInSample' - The number of profiles found in this preview dry run.
--
-- 'numberOfProfilesWillBeMerged', 'getAutoMergingPreviewResponse_numberOfProfilesWillBeMerged' - The number of profiles that would be merged if this wasn\'t a preview
-- dry run.
--
-- 'httpStatus', 'getAutoMergingPreviewResponse_httpStatus' - The response's http status code.
--
-- 'domainName', 'getAutoMergingPreviewResponse_domainName' - The unique name of the domain.
newGetAutoMergingPreviewResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'domainName'
  Prelude.Text ->
  GetAutoMergingPreviewResponse
newGetAutoMergingPreviewResponse :: Int -> Text -> GetAutoMergingPreviewResponse
newGetAutoMergingPreviewResponse
  Int
pHttpStatus_
  Text
pDomainName_ =
    GetAutoMergingPreviewResponse'
      { $sel:numberOfMatchesInSample:GetAutoMergingPreviewResponse' :: Maybe Integer
numberOfMatchesInSample =
          forall a. Maybe a
Prelude.Nothing,
        $sel:numberOfProfilesInSample:GetAutoMergingPreviewResponse' :: Maybe Integer
numberOfProfilesInSample = forall a. Maybe a
Prelude.Nothing,
        $sel:numberOfProfilesWillBeMerged:GetAutoMergingPreviewResponse' :: Maybe Integer
numberOfProfilesWillBeMerged =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetAutoMergingPreviewResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:domainName:GetAutoMergingPreviewResponse' :: Text
domainName = Text
pDomainName_
      }

-- | The number of match groups in the domain that have been reviewed in this
-- preview dry run.
getAutoMergingPreviewResponse_numberOfMatchesInSample :: Lens.Lens' GetAutoMergingPreviewResponse (Prelude.Maybe Prelude.Integer)
getAutoMergingPreviewResponse_numberOfMatchesInSample :: Lens' GetAutoMergingPreviewResponse (Maybe Integer)
getAutoMergingPreviewResponse_numberOfMatchesInSample = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreviewResponse' {Maybe Integer
numberOfMatchesInSample :: Maybe Integer
$sel:numberOfMatchesInSample:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Maybe Integer
numberOfMatchesInSample} -> Maybe Integer
numberOfMatchesInSample) (\s :: GetAutoMergingPreviewResponse
s@GetAutoMergingPreviewResponse' {} Maybe Integer
a -> GetAutoMergingPreviewResponse
s {$sel:numberOfMatchesInSample:GetAutoMergingPreviewResponse' :: Maybe Integer
numberOfMatchesInSample = Maybe Integer
a} :: GetAutoMergingPreviewResponse)

-- | The number of profiles found in this preview dry run.
getAutoMergingPreviewResponse_numberOfProfilesInSample :: Lens.Lens' GetAutoMergingPreviewResponse (Prelude.Maybe Prelude.Integer)
getAutoMergingPreviewResponse_numberOfProfilesInSample :: Lens' GetAutoMergingPreviewResponse (Maybe Integer)
getAutoMergingPreviewResponse_numberOfProfilesInSample = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreviewResponse' {Maybe Integer
numberOfProfilesInSample :: Maybe Integer
$sel:numberOfProfilesInSample:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Maybe Integer
numberOfProfilesInSample} -> Maybe Integer
numberOfProfilesInSample) (\s :: GetAutoMergingPreviewResponse
s@GetAutoMergingPreviewResponse' {} Maybe Integer
a -> GetAutoMergingPreviewResponse
s {$sel:numberOfProfilesInSample:GetAutoMergingPreviewResponse' :: Maybe Integer
numberOfProfilesInSample = Maybe Integer
a} :: GetAutoMergingPreviewResponse)

-- | The number of profiles that would be merged if this wasn\'t a preview
-- dry run.
getAutoMergingPreviewResponse_numberOfProfilesWillBeMerged :: Lens.Lens' GetAutoMergingPreviewResponse (Prelude.Maybe Prelude.Integer)
getAutoMergingPreviewResponse_numberOfProfilesWillBeMerged :: Lens' GetAutoMergingPreviewResponse (Maybe Integer)
getAutoMergingPreviewResponse_numberOfProfilesWillBeMerged = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreviewResponse' {Maybe Integer
numberOfProfilesWillBeMerged :: Maybe Integer
$sel:numberOfProfilesWillBeMerged:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Maybe Integer
numberOfProfilesWillBeMerged} -> Maybe Integer
numberOfProfilesWillBeMerged) (\s :: GetAutoMergingPreviewResponse
s@GetAutoMergingPreviewResponse' {} Maybe Integer
a -> GetAutoMergingPreviewResponse
s {$sel:numberOfProfilesWillBeMerged:GetAutoMergingPreviewResponse' :: Maybe Integer
numberOfProfilesWillBeMerged = Maybe Integer
a} :: GetAutoMergingPreviewResponse)

-- | The response's http status code.
getAutoMergingPreviewResponse_httpStatus :: Lens.Lens' GetAutoMergingPreviewResponse Prelude.Int
getAutoMergingPreviewResponse_httpStatus :: Lens' GetAutoMergingPreviewResponse Int
getAutoMergingPreviewResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreviewResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAutoMergingPreviewResponse
s@GetAutoMergingPreviewResponse' {} Int
a -> GetAutoMergingPreviewResponse
s {$sel:httpStatus:GetAutoMergingPreviewResponse' :: Int
httpStatus = Int
a} :: GetAutoMergingPreviewResponse)

-- | The unique name of the domain.
getAutoMergingPreviewResponse_domainName :: Lens.Lens' GetAutoMergingPreviewResponse Prelude.Text
getAutoMergingPreviewResponse_domainName :: Lens' GetAutoMergingPreviewResponse Text
getAutoMergingPreviewResponse_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAutoMergingPreviewResponse' {Text
domainName :: Text
$sel:domainName:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Text
domainName} -> Text
domainName) (\s :: GetAutoMergingPreviewResponse
s@GetAutoMergingPreviewResponse' {} Text
a -> GetAutoMergingPreviewResponse
s {$sel:domainName:GetAutoMergingPreviewResponse' :: Text
domainName = Text
a} :: GetAutoMergingPreviewResponse)

instance Prelude.NFData GetAutoMergingPreviewResponse where
  rnf :: GetAutoMergingPreviewResponse -> ()
rnf GetAutoMergingPreviewResponse' {Int
Maybe Integer
Text
domainName :: Text
httpStatus :: Int
numberOfProfilesWillBeMerged :: Maybe Integer
numberOfProfilesInSample :: Maybe Integer
numberOfMatchesInSample :: Maybe Integer
$sel:domainName:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Text
$sel:httpStatus:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Int
$sel:numberOfProfilesWillBeMerged:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Maybe Integer
$sel:numberOfProfilesInSample:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Maybe Integer
$sel:numberOfMatchesInSample:GetAutoMergingPreviewResponse' :: GetAutoMergingPreviewResponse -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
numberOfMatchesInSample
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
numberOfProfilesInSample
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
numberOfProfilesWillBeMerged
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domainName