{-# 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.MergeProfiles
-- 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)
--
-- This API is in preview release for Amazon Connect and subject to change.
--
-- Runs an AWS Lambda job that does the following:
--
-- 1.  All the profileKeys in the @ProfileToBeMerged@ will be moved to the
--     main profile.
--
-- 2.  All the objects in the @ProfileToBeMerged@ will be moved to the main
--     profile.
--
-- 3.  All the @ProfileToBeMerged@ will be deleted at the end.
--
-- 4.  All the profileKeys in the @ProfileIdsToBeMerged@ will be moved to
--     the main profile.
--
-- 5.  Standard fields are merged as follows:
--
--     1.  Fields are always \"union\"-ed if there are no conflicts in
--         standard fields or attributeKeys.
--
--     2.  When there are conflicting fields:
--
--         1.  If no @SourceProfileIds@ entry is specified, the main
--             Profile value is always taken.
--
--         2.  If a @SourceProfileIds@ entry is specified, the specified
--             profileId is always taken, even if it is a NULL value.
--
-- You can use MergeProfiles together with
-- <https://docs.aws.amazon.com/customerprofiles/latest/APIReference/API_GetMatches.html GetMatches>,
-- which returns potentially matching profiles, or use it with the results
-- of another matching system. After profiles have been merged, they cannot
-- be separated (unmerged).
module Amazonka.CustomerProfiles.MergeProfiles
  ( -- * Creating a Request
    MergeProfiles (..),
    newMergeProfiles,

    -- * Request Lenses
    mergeProfiles_fieldSourceProfileIds,
    mergeProfiles_domainName,
    mergeProfiles_mainProfileId,
    mergeProfiles_profileIdsToBeMerged,

    -- * Destructuring the Response
    MergeProfilesResponse (..),
    newMergeProfilesResponse,

    -- * Response Lenses
    mergeProfilesResponse_message,
    mergeProfilesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newMergeProfiles' smart constructor.
data MergeProfiles = MergeProfiles'
  { -- | The identifiers of the fields in the profile that has the information
    -- you want to apply to the merge. For example, say you want to merge
    -- EmailAddress from Profile1 into MainProfile. This would be the
    -- identifier of the EmailAddress field in Profile1.
    MergeProfiles -> Maybe FieldSourceProfileIds
fieldSourceProfileIds :: Prelude.Maybe FieldSourceProfileIds,
    -- | The unique name of the domain.
    MergeProfiles -> Text
domainName :: Prelude.Text,
    -- | The identifier of the profile to be taken.
    MergeProfiles -> Text
mainProfileId :: Prelude.Text,
    -- | The identifier of the profile to be merged into MainProfileId.
    MergeProfiles -> NonEmpty Text
profileIdsToBeMerged :: Prelude.NonEmpty Prelude.Text
  }
  deriving (MergeProfiles -> MergeProfiles -> Bool
(MergeProfiles -> MergeProfiles -> Bool)
-> (MergeProfiles -> MergeProfiles -> Bool) -> Eq MergeProfiles
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeProfiles -> MergeProfiles -> Bool
$c/= :: MergeProfiles -> MergeProfiles -> Bool
== :: MergeProfiles -> MergeProfiles -> Bool
$c== :: MergeProfiles -> MergeProfiles -> Bool
Prelude.Eq, ReadPrec [MergeProfiles]
ReadPrec MergeProfiles
Int -> ReadS MergeProfiles
ReadS [MergeProfiles]
(Int -> ReadS MergeProfiles)
-> ReadS [MergeProfiles]
-> ReadPrec MergeProfiles
-> ReadPrec [MergeProfiles]
-> Read MergeProfiles
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergeProfiles]
$creadListPrec :: ReadPrec [MergeProfiles]
readPrec :: ReadPrec MergeProfiles
$creadPrec :: ReadPrec MergeProfiles
readList :: ReadS [MergeProfiles]
$creadList :: ReadS [MergeProfiles]
readsPrec :: Int -> ReadS MergeProfiles
$creadsPrec :: Int -> ReadS MergeProfiles
Prelude.Read, Int -> MergeProfiles -> ShowS
[MergeProfiles] -> ShowS
MergeProfiles -> String
(Int -> MergeProfiles -> ShowS)
-> (MergeProfiles -> String)
-> ([MergeProfiles] -> ShowS)
-> Show MergeProfiles
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeProfiles] -> ShowS
$cshowList :: [MergeProfiles] -> ShowS
show :: MergeProfiles -> String
$cshow :: MergeProfiles -> String
showsPrec :: Int -> MergeProfiles -> ShowS
$cshowsPrec :: Int -> MergeProfiles -> ShowS
Prelude.Show, (forall x. MergeProfiles -> Rep MergeProfiles x)
-> (forall x. Rep MergeProfiles x -> MergeProfiles)
-> Generic MergeProfiles
forall x. Rep MergeProfiles x -> MergeProfiles
forall x. MergeProfiles -> Rep MergeProfiles x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MergeProfiles x -> MergeProfiles
$cfrom :: forall x. MergeProfiles -> Rep MergeProfiles x
Prelude.Generic)

-- |
-- Create a value of 'MergeProfiles' 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:
--
-- 'fieldSourceProfileIds', 'mergeProfiles_fieldSourceProfileIds' - The identifiers of the fields in the profile that has the information
-- you want to apply to the merge. For example, say you want to merge
-- EmailAddress from Profile1 into MainProfile. This would be the
-- identifier of the EmailAddress field in Profile1.
--
-- 'domainName', 'mergeProfiles_domainName' - The unique name of the domain.
--
-- 'mainProfileId', 'mergeProfiles_mainProfileId' - The identifier of the profile to be taken.
--
-- 'profileIdsToBeMerged', 'mergeProfiles_profileIdsToBeMerged' - The identifier of the profile to be merged into MainProfileId.
newMergeProfiles ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'mainProfileId'
  Prelude.Text ->
  -- | 'profileIdsToBeMerged'
  Prelude.NonEmpty Prelude.Text ->
  MergeProfiles
newMergeProfiles :: Text -> Text -> NonEmpty Text -> MergeProfiles
newMergeProfiles
  Text
pDomainName_
  Text
pMainProfileId_
  NonEmpty Text
pProfileIdsToBeMerged_ =
    MergeProfiles' :: Maybe FieldSourceProfileIds
-> Text -> Text -> NonEmpty Text -> MergeProfiles
MergeProfiles'
      { $sel:fieldSourceProfileIds:MergeProfiles' :: Maybe FieldSourceProfileIds
fieldSourceProfileIds =
          Maybe FieldSourceProfileIds
forall a. Maybe a
Prelude.Nothing,
        $sel:domainName:MergeProfiles' :: Text
domainName = Text
pDomainName_,
        $sel:mainProfileId:MergeProfiles' :: Text
mainProfileId = Text
pMainProfileId_,
        $sel:profileIdsToBeMerged:MergeProfiles' :: NonEmpty Text
profileIdsToBeMerged =
          Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pProfileIdsToBeMerged_
      }

-- | The identifiers of the fields in the profile that has the information
-- you want to apply to the merge. For example, say you want to merge
-- EmailAddress from Profile1 into MainProfile. This would be the
-- identifier of the EmailAddress field in Profile1.
mergeProfiles_fieldSourceProfileIds :: Lens.Lens' MergeProfiles (Prelude.Maybe FieldSourceProfileIds)
mergeProfiles_fieldSourceProfileIds :: (Maybe FieldSourceProfileIds -> f (Maybe FieldSourceProfileIds))
-> MergeProfiles -> f MergeProfiles
mergeProfiles_fieldSourceProfileIds = (MergeProfiles -> Maybe FieldSourceProfileIds)
-> (MergeProfiles -> Maybe FieldSourceProfileIds -> MergeProfiles)
-> Lens
     MergeProfiles
     MergeProfiles
     (Maybe FieldSourceProfileIds)
     (Maybe FieldSourceProfileIds)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeProfiles' {Maybe FieldSourceProfileIds
fieldSourceProfileIds :: Maybe FieldSourceProfileIds
$sel:fieldSourceProfileIds:MergeProfiles' :: MergeProfiles -> Maybe FieldSourceProfileIds
fieldSourceProfileIds} -> Maybe FieldSourceProfileIds
fieldSourceProfileIds) (\s :: MergeProfiles
s@MergeProfiles' {} Maybe FieldSourceProfileIds
a -> MergeProfiles
s {$sel:fieldSourceProfileIds:MergeProfiles' :: Maybe FieldSourceProfileIds
fieldSourceProfileIds = Maybe FieldSourceProfileIds
a} :: MergeProfiles)

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

-- | The identifier of the profile to be taken.
mergeProfiles_mainProfileId :: Lens.Lens' MergeProfiles Prelude.Text
mergeProfiles_mainProfileId :: (Text -> f Text) -> MergeProfiles -> f MergeProfiles
mergeProfiles_mainProfileId = (MergeProfiles -> Text)
-> (MergeProfiles -> Text -> MergeProfiles)
-> Lens MergeProfiles MergeProfiles Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeProfiles' {Text
mainProfileId :: Text
$sel:mainProfileId:MergeProfiles' :: MergeProfiles -> Text
mainProfileId} -> Text
mainProfileId) (\s :: MergeProfiles
s@MergeProfiles' {} Text
a -> MergeProfiles
s {$sel:mainProfileId:MergeProfiles' :: Text
mainProfileId = Text
a} :: MergeProfiles)

-- | The identifier of the profile to be merged into MainProfileId.
mergeProfiles_profileIdsToBeMerged :: Lens.Lens' MergeProfiles (Prelude.NonEmpty Prelude.Text)
mergeProfiles_profileIdsToBeMerged :: (NonEmpty Text -> f (NonEmpty Text))
-> MergeProfiles -> f MergeProfiles
mergeProfiles_profileIdsToBeMerged = (MergeProfiles -> NonEmpty Text)
-> (MergeProfiles -> NonEmpty Text -> MergeProfiles)
-> Lens MergeProfiles MergeProfiles (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeProfiles' {NonEmpty Text
profileIdsToBeMerged :: NonEmpty Text
$sel:profileIdsToBeMerged:MergeProfiles' :: MergeProfiles -> NonEmpty Text
profileIdsToBeMerged} -> NonEmpty Text
profileIdsToBeMerged) (\s :: MergeProfiles
s@MergeProfiles' {} NonEmpty Text
a -> MergeProfiles
s {$sel:profileIdsToBeMerged:MergeProfiles' :: NonEmpty Text
profileIdsToBeMerged = NonEmpty Text
a} :: MergeProfiles) ((NonEmpty Text -> f (NonEmpty Text))
 -> MergeProfiles -> f MergeProfiles)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> MergeProfiles
-> f MergeProfiles
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest MergeProfiles where
  type
    AWSResponse MergeProfiles =
      MergeProfilesResponse
  request :: MergeProfiles -> Request MergeProfiles
request = Service -> MergeProfiles -> Request MergeProfiles
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy MergeProfiles
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse MergeProfiles)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse MergeProfiles))
-> Logger
-> Service
-> Proxy MergeProfiles
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse MergeProfiles)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> MergeProfilesResponse
MergeProfilesResponse'
            (Maybe Text -> Int -> MergeProfilesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> MergeProfilesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Message")
            Either String (Int -> MergeProfilesResponse)
-> Either String Int -> Either String MergeProfilesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable MergeProfiles

instance Prelude.NFData MergeProfiles

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

instance Core.ToJSON MergeProfiles where
  toJSON :: MergeProfiles -> Value
toJSON MergeProfiles' {Maybe FieldSourceProfileIds
NonEmpty Text
Text
profileIdsToBeMerged :: NonEmpty Text
mainProfileId :: Text
domainName :: Text
fieldSourceProfileIds :: Maybe FieldSourceProfileIds
$sel:profileIdsToBeMerged:MergeProfiles' :: MergeProfiles -> NonEmpty Text
$sel:mainProfileId:MergeProfiles' :: MergeProfiles -> Text
$sel:domainName:MergeProfiles' :: MergeProfiles -> Text
$sel:fieldSourceProfileIds:MergeProfiles' :: MergeProfiles -> Maybe FieldSourceProfileIds
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"FieldSourceProfileIds" Text -> FieldSourceProfileIds -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (FieldSourceProfileIds -> Pair)
-> Maybe FieldSourceProfileIds -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FieldSourceProfileIds
fieldSourceProfileIds,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MainProfileId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
mainProfileId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"ProfileIdsToBeMerged"
                  Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
profileIdsToBeMerged
              )
          ]
      )

instance Core.ToPath MergeProfiles where
  toPath :: MergeProfiles -> ByteString
toPath MergeProfiles' {Maybe FieldSourceProfileIds
NonEmpty Text
Text
profileIdsToBeMerged :: NonEmpty Text
mainProfileId :: Text
domainName :: Text
fieldSourceProfileIds :: Maybe FieldSourceProfileIds
$sel:profileIdsToBeMerged:MergeProfiles' :: MergeProfiles -> NonEmpty Text
$sel:mainProfileId:MergeProfiles' :: MergeProfiles -> Text
$sel:domainName:MergeProfiles' :: MergeProfiles -> Text
$sel:fieldSourceProfileIds:MergeProfiles' :: MergeProfiles -> Maybe FieldSourceProfileIds
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/domains/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
domainName,
        ByteString
"/profiles/objects/merge"
      ]

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

-- | /See:/ 'newMergeProfilesResponse' smart constructor.
data MergeProfilesResponse = MergeProfilesResponse'
  { -- | A message that indicates the merge request is complete.
    MergeProfilesResponse -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    MergeProfilesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (MergeProfilesResponse -> MergeProfilesResponse -> Bool
(MergeProfilesResponse -> MergeProfilesResponse -> Bool)
-> (MergeProfilesResponse -> MergeProfilesResponse -> Bool)
-> Eq MergeProfilesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MergeProfilesResponse -> MergeProfilesResponse -> Bool
$c/= :: MergeProfilesResponse -> MergeProfilesResponse -> Bool
== :: MergeProfilesResponse -> MergeProfilesResponse -> Bool
$c== :: MergeProfilesResponse -> MergeProfilesResponse -> Bool
Prelude.Eq, ReadPrec [MergeProfilesResponse]
ReadPrec MergeProfilesResponse
Int -> ReadS MergeProfilesResponse
ReadS [MergeProfilesResponse]
(Int -> ReadS MergeProfilesResponse)
-> ReadS [MergeProfilesResponse]
-> ReadPrec MergeProfilesResponse
-> ReadPrec [MergeProfilesResponse]
-> Read MergeProfilesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MergeProfilesResponse]
$creadListPrec :: ReadPrec [MergeProfilesResponse]
readPrec :: ReadPrec MergeProfilesResponse
$creadPrec :: ReadPrec MergeProfilesResponse
readList :: ReadS [MergeProfilesResponse]
$creadList :: ReadS [MergeProfilesResponse]
readsPrec :: Int -> ReadS MergeProfilesResponse
$creadsPrec :: Int -> ReadS MergeProfilesResponse
Prelude.Read, Int -> MergeProfilesResponse -> ShowS
[MergeProfilesResponse] -> ShowS
MergeProfilesResponse -> String
(Int -> MergeProfilesResponse -> ShowS)
-> (MergeProfilesResponse -> String)
-> ([MergeProfilesResponse] -> ShowS)
-> Show MergeProfilesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MergeProfilesResponse] -> ShowS
$cshowList :: [MergeProfilesResponse] -> ShowS
show :: MergeProfilesResponse -> String
$cshow :: MergeProfilesResponse -> String
showsPrec :: Int -> MergeProfilesResponse -> ShowS
$cshowsPrec :: Int -> MergeProfilesResponse -> ShowS
Prelude.Show, (forall x. MergeProfilesResponse -> Rep MergeProfilesResponse x)
-> (forall x. Rep MergeProfilesResponse x -> MergeProfilesResponse)
-> Generic MergeProfilesResponse
forall x. Rep MergeProfilesResponse x -> MergeProfilesResponse
forall x. MergeProfilesResponse -> Rep MergeProfilesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MergeProfilesResponse x -> MergeProfilesResponse
$cfrom :: forall x. MergeProfilesResponse -> Rep MergeProfilesResponse x
Prelude.Generic)

-- |
-- Create a value of 'MergeProfilesResponse' 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:
--
-- 'message', 'mergeProfilesResponse_message' - A message that indicates the merge request is complete.
--
-- 'httpStatus', 'mergeProfilesResponse_httpStatus' - The response's http status code.
newMergeProfilesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  MergeProfilesResponse
newMergeProfilesResponse :: Int -> MergeProfilesResponse
newMergeProfilesResponse Int
pHttpStatus_ =
  MergeProfilesResponse' :: Maybe Text -> Int -> MergeProfilesResponse
MergeProfilesResponse'
    { $sel:message:MergeProfilesResponse' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:MergeProfilesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A message that indicates the merge request is complete.
mergeProfilesResponse_message :: Lens.Lens' MergeProfilesResponse (Prelude.Maybe Prelude.Text)
mergeProfilesResponse_message :: (Maybe Text -> f (Maybe Text))
-> MergeProfilesResponse -> f MergeProfilesResponse
mergeProfilesResponse_message = (MergeProfilesResponse -> Maybe Text)
-> (MergeProfilesResponse -> Maybe Text -> MergeProfilesResponse)
-> Lens
     MergeProfilesResponse
     MergeProfilesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MergeProfilesResponse' {Maybe Text
message :: Maybe Text
$sel:message:MergeProfilesResponse' :: MergeProfilesResponse -> Maybe Text
message} -> Maybe Text
message) (\s :: MergeProfilesResponse
s@MergeProfilesResponse' {} Maybe Text
a -> MergeProfilesResponse
s {$sel:message:MergeProfilesResponse' :: Maybe Text
message = Maybe Text
a} :: MergeProfilesResponse)

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

instance Prelude.NFData MergeProfilesResponse