{-# 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.SESV2.GetContact
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a contact from a contact list.
module Amazonka.SESV2.GetContact
  ( -- * Creating a Request
    GetContact (..),
    newGetContact,

    -- * Request Lenses
    getContact_contactListName,
    getContact_emailAddress,

    -- * Destructuring the Response
    GetContactResponse (..),
    newGetContactResponse,

    -- * Response Lenses
    getContactResponse_attributesData,
    getContactResponse_contactListName,
    getContactResponse_createdTimestamp,
    getContactResponse_emailAddress,
    getContactResponse_lastUpdatedTimestamp,
    getContactResponse_topicDefaultPreferences,
    getContactResponse_topicPreferences,
    getContactResponse_unsubscribeAll,
    getContactResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetContact' smart constructor.
data GetContact = GetContact'
  { -- | The name of the contact list to which the contact belongs.
    GetContact -> Text
contactListName :: Prelude.Text,
    -- | The contact\'s email addres.
    GetContact -> Text
emailAddress :: Prelude.Text
  }
  deriving (GetContact -> GetContact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContact -> GetContact -> Bool
$c/= :: GetContact -> GetContact -> Bool
== :: GetContact -> GetContact -> Bool
$c== :: GetContact -> GetContact -> Bool
Prelude.Eq, ReadPrec [GetContact]
ReadPrec GetContact
Int -> ReadS GetContact
ReadS [GetContact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContact]
$creadListPrec :: ReadPrec [GetContact]
readPrec :: ReadPrec GetContact
$creadPrec :: ReadPrec GetContact
readList :: ReadS [GetContact]
$creadList :: ReadS [GetContact]
readsPrec :: Int -> ReadS GetContact
$creadsPrec :: Int -> ReadS GetContact
Prelude.Read, Int -> GetContact -> ShowS
[GetContact] -> ShowS
GetContact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContact] -> ShowS
$cshowList :: [GetContact] -> ShowS
show :: GetContact -> String
$cshow :: GetContact -> String
showsPrec :: Int -> GetContact -> ShowS
$cshowsPrec :: Int -> GetContact -> ShowS
Prelude.Show, forall x. Rep GetContact x -> GetContact
forall x. GetContact -> Rep GetContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetContact x -> GetContact
$cfrom :: forall x. GetContact -> Rep GetContact x
Prelude.Generic)

-- |
-- Create a value of 'GetContact' 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:
--
-- 'contactListName', 'getContact_contactListName' - The name of the contact list to which the contact belongs.
--
-- 'emailAddress', 'getContact_emailAddress' - The contact\'s email addres.
newGetContact ::
  -- | 'contactListName'
  Prelude.Text ->
  -- | 'emailAddress'
  Prelude.Text ->
  GetContact
newGetContact :: Text -> Text -> GetContact
newGetContact Text
pContactListName_ Text
pEmailAddress_ =
  GetContact'
    { $sel:contactListName:GetContact' :: Text
contactListName = Text
pContactListName_,
      $sel:emailAddress:GetContact' :: Text
emailAddress = Text
pEmailAddress_
    }

-- | The name of the contact list to which the contact belongs.
getContact_contactListName :: Lens.Lens' GetContact Prelude.Text
getContact_contactListName :: Lens' GetContact Text
getContact_contactListName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContact' {Text
contactListName :: Text
$sel:contactListName:GetContact' :: GetContact -> Text
contactListName} -> Text
contactListName) (\s :: GetContact
s@GetContact' {} Text
a -> GetContact
s {$sel:contactListName:GetContact' :: Text
contactListName = Text
a} :: GetContact)

-- | The contact\'s email addres.
getContact_emailAddress :: Lens.Lens' GetContact Prelude.Text
getContact_emailAddress :: Lens' GetContact Text
getContact_emailAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContact' {Text
emailAddress :: Text
$sel:emailAddress:GetContact' :: GetContact -> Text
emailAddress} -> Text
emailAddress) (\s :: GetContact
s@GetContact' {} Text
a -> GetContact
s {$sel:emailAddress:GetContact' :: Text
emailAddress = Text
a} :: GetContact)

instance Core.AWSRequest GetContact where
  type AWSResponse GetContact = GetContactResponse
  request :: (Service -> Service) -> GetContact -> Request GetContact
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetContact)))
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 Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe [TopicPreference]
-> Maybe [TopicPreference]
-> Maybe Bool
-> Int
-> GetContactResponse
GetContactResponse'
            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
"AttributesData")
            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
"ContactListName")
            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
"CreatedTimestamp")
            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
"EmailAddress")
            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
"LastUpdatedTimestamp")
            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
"TopicDefaultPreferences"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            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
"TopicPreferences"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            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
"UnsubscribeAll")
            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))
      )

instance Prelude.Hashable GetContact where
  hashWithSalt :: Int -> GetContact -> Int
hashWithSalt Int
_salt GetContact' {Text
emailAddress :: Text
contactListName :: Text
$sel:emailAddress:GetContact' :: GetContact -> Text
$sel:contactListName:GetContact' :: GetContact -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactListName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
emailAddress

instance Prelude.NFData GetContact where
  rnf :: GetContact -> ()
rnf GetContact' {Text
emailAddress :: Text
contactListName :: Text
$sel:emailAddress:GetContact' :: GetContact -> Text
$sel:contactListName:GetContact' :: GetContact -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
contactListName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
emailAddress

instance Data.ToHeaders GetContact where
  toHeaders :: GetContact -> 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.ToPath GetContact where
  toPath :: GetContact -> ByteString
toPath GetContact' {Text
emailAddress :: Text
contactListName :: Text
$sel:emailAddress:GetContact' :: GetContact -> Text
$sel:contactListName:GetContact' :: GetContact -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v2/email/contact-lists/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
contactListName,
        ByteString
"/contacts/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
emailAddress
      ]

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

-- | /See:/ 'newGetContactResponse' smart constructor.
data GetContactResponse = GetContactResponse'
  { -- | The attribute data attached to a contact.
    GetContactResponse -> Maybe Text
attributesData :: Prelude.Maybe Prelude.Text,
    -- | The name of the contact list to which the contact belongs.
    GetContactResponse -> Maybe Text
contactListName :: Prelude.Maybe Prelude.Text,
    -- | A timestamp noting when the contact was created.
    GetContactResponse -> Maybe POSIX
createdTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The contact\'s email addres.
    GetContactResponse -> Maybe Text
emailAddress :: Prelude.Maybe Prelude.Text,
    -- | A timestamp noting the last time the contact\'s information was updated.
    GetContactResponse -> Maybe POSIX
lastUpdatedTimestamp :: Prelude.Maybe Data.POSIX,
    -- | The default topic preferences applied to the contact.
    GetContactResponse -> Maybe [TopicPreference]
topicDefaultPreferences :: Prelude.Maybe [TopicPreference],
    -- | The contact\'s preference for being opted-in to or opted-out of a
    -- topic.>
    GetContactResponse -> Maybe [TopicPreference]
topicPreferences :: Prelude.Maybe [TopicPreference],
    -- | A boolean value status noting if the contact is unsubscribed from all
    -- contact list topics.
    GetContactResponse -> Maybe Bool
unsubscribeAll :: Prelude.Maybe Prelude.Bool,
    -- | The response's http status code.
    GetContactResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetContactResponse -> GetContactResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContactResponse -> GetContactResponse -> Bool
$c/= :: GetContactResponse -> GetContactResponse -> Bool
== :: GetContactResponse -> GetContactResponse -> Bool
$c== :: GetContactResponse -> GetContactResponse -> Bool
Prelude.Eq, ReadPrec [GetContactResponse]
ReadPrec GetContactResponse
Int -> ReadS GetContactResponse
ReadS [GetContactResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContactResponse]
$creadListPrec :: ReadPrec [GetContactResponse]
readPrec :: ReadPrec GetContactResponse
$creadPrec :: ReadPrec GetContactResponse
readList :: ReadS [GetContactResponse]
$creadList :: ReadS [GetContactResponse]
readsPrec :: Int -> ReadS GetContactResponse
$creadsPrec :: Int -> ReadS GetContactResponse
Prelude.Read, Int -> GetContactResponse -> ShowS
[GetContactResponse] -> ShowS
GetContactResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContactResponse] -> ShowS
$cshowList :: [GetContactResponse] -> ShowS
show :: GetContactResponse -> String
$cshow :: GetContactResponse -> String
showsPrec :: Int -> GetContactResponse -> ShowS
$cshowsPrec :: Int -> GetContactResponse -> ShowS
Prelude.Show, forall x. Rep GetContactResponse x -> GetContactResponse
forall x. GetContactResponse -> Rep GetContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetContactResponse x -> GetContactResponse
$cfrom :: forall x. GetContactResponse -> Rep GetContactResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetContactResponse' 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:
--
-- 'attributesData', 'getContactResponse_attributesData' - The attribute data attached to a contact.
--
-- 'contactListName', 'getContactResponse_contactListName' - The name of the contact list to which the contact belongs.
--
-- 'createdTimestamp', 'getContactResponse_createdTimestamp' - A timestamp noting when the contact was created.
--
-- 'emailAddress', 'getContactResponse_emailAddress' - The contact\'s email addres.
--
-- 'lastUpdatedTimestamp', 'getContactResponse_lastUpdatedTimestamp' - A timestamp noting the last time the contact\'s information was updated.
--
-- 'topicDefaultPreferences', 'getContactResponse_topicDefaultPreferences' - The default topic preferences applied to the contact.
--
-- 'topicPreferences', 'getContactResponse_topicPreferences' - The contact\'s preference for being opted-in to or opted-out of a
-- topic.>
--
-- 'unsubscribeAll', 'getContactResponse_unsubscribeAll' - A boolean value status noting if the contact is unsubscribed from all
-- contact list topics.
--
-- 'httpStatus', 'getContactResponse_httpStatus' - The response's http status code.
newGetContactResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetContactResponse
newGetContactResponse :: Int -> GetContactResponse
newGetContactResponse Int
pHttpStatus_ =
  GetContactResponse'
    { $sel:attributesData:GetContactResponse' :: Maybe Text
attributesData =
        forall a. Maybe a
Prelude.Nothing,
      $sel:contactListName:GetContactResponse' :: Maybe Text
contactListName = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:GetContactResponse' :: Maybe POSIX
createdTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:emailAddress:GetContactResponse' :: Maybe Text
emailAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTimestamp:GetContactResponse' :: Maybe POSIX
lastUpdatedTimestamp = forall a. Maybe a
Prelude.Nothing,
      $sel:topicDefaultPreferences:GetContactResponse' :: Maybe [TopicPreference]
topicDefaultPreferences = forall a. Maybe a
Prelude.Nothing,
      $sel:topicPreferences:GetContactResponse' :: Maybe [TopicPreference]
topicPreferences = forall a. Maybe a
Prelude.Nothing,
      $sel:unsubscribeAll:GetContactResponse' :: Maybe Bool
unsubscribeAll = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetContactResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The attribute data attached to a contact.
getContactResponse_attributesData :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.Text)
getContactResponse_attributesData :: Lens' GetContactResponse (Maybe Text)
getContactResponse_attributesData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe Text
attributesData :: Maybe Text
$sel:attributesData:GetContactResponse' :: GetContactResponse -> Maybe Text
attributesData} -> Maybe Text
attributesData) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe Text
a -> GetContactResponse
s {$sel:attributesData:GetContactResponse' :: Maybe Text
attributesData = Maybe Text
a} :: GetContactResponse)

-- | The name of the contact list to which the contact belongs.
getContactResponse_contactListName :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.Text)
getContactResponse_contactListName :: Lens' GetContactResponse (Maybe Text)
getContactResponse_contactListName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe Text
contactListName :: Maybe Text
$sel:contactListName:GetContactResponse' :: GetContactResponse -> Maybe Text
contactListName} -> Maybe Text
contactListName) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe Text
a -> GetContactResponse
s {$sel:contactListName:GetContactResponse' :: Maybe Text
contactListName = Maybe Text
a} :: GetContactResponse)

-- | A timestamp noting when the contact was created.
getContactResponse_createdTimestamp :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.UTCTime)
getContactResponse_createdTimestamp :: Lens' GetContactResponse (Maybe UTCTime)
getContactResponse_createdTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe POSIX
createdTimestamp :: Maybe POSIX
$sel:createdTimestamp:GetContactResponse' :: GetContactResponse -> Maybe POSIX
createdTimestamp} -> Maybe POSIX
createdTimestamp) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe POSIX
a -> GetContactResponse
s {$sel:createdTimestamp:GetContactResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
a} :: GetContactResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The contact\'s email addres.
getContactResponse_emailAddress :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.Text)
getContactResponse_emailAddress :: Lens' GetContactResponse (Maybe Text)
getContactResponse_emailAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe Text
emailAddress :: Maybe Text
$sel:emailAddress:GetContactResponse' :: GetContactResponse -> Maybe Text
emailAddress} -> Maybe Text
emailAddress) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe Text
a -> GetContactResponse
s {$sel:emailAddress:GetContactResponse' :: Maybe Text
emailAddress = Maybe Text
a} :: GetContactResponse)

-- | A timestamp noting the last time the contact\'s information was updated.
getContactResponse_lastUpdatedTimestamp :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.UTCTime)
getContactResponse_lastUpdatedTimestamp :: Lens' GetContactResponse (Maybe UTCTime)
getContactResponse_lastUpdatedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe POSIX
lastUpdatedTimestamp :: Maybe POSIX
$sel:lastUpdatedTimestamp:GetContactResponse' :: GetContactResponse -> Maybe POSIX
lastUpdatedTimestamp} -> Maybe POSIX
lastUpdatedTimestamp) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe POSIX
a -> GetContactResponse
s {$sel:lastUpdatedTimestamp:GetContactResponse' :: Maybe POSIX
lastUpdatedTimestamp = Maybe POSIX
a} :: GetContactResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The default topic preferences applied to the contact.
getContactResponse_topicDefaultPreferences :: Lens.Lens' GetContactResponse (Prelude.Maybe [TopicPreference])
getContactResponse_topicDefaultPreferences :: Lens' GetContactResponse (Maybe [TopicPreference])
getContactResponse_topicDefaultPreferences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe [TopicPreference]
topicDefaultPreferences :: Maybe [TopicPreference]
$sel:topicDefaultPreferences:GetContactResponse' :: GetContactResponse -> Maybe [TopicPreference]
topicDefaultPreferences} -> Maybe [TopicPreference]
topicDefaultPreferences) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe [TopicPreference]
a -> GetContactResponse
s {$sel:topicDefaultPreferences:GetContactResponse' :: Maybe [TopicPreference]
topicDefaultPreferences = Maybe [TopicPreference]
a} :: GetContactResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The contact\'s preference for being opted-in to or opted-out of a
-- topic.>
getContactResponse_topicPreferences :: Lens.Lens' GetContactResponse (Prelude.Maybe [TopicPreference])
getContactResponse_topicPreferences :: Lens' GetContactResponse (Maybe [TopicPreference])
getContactResponse_topicPreferences = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe [TopicPreference]
topicPreferences :: Maybe [TopicPreference]
$sel:topicPreferences:GetContactResponse' :: GetContactResponse -> Maybe [TopicPreference]
topicPreferences} -> Maybe [TopicPreference]
topicPreferences) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe [TopicPreference]
a -> GetContactResponse
s {$sel:topicPreferences:GetContactResponse' :: Maybe [TopicPreference]
topicPreferences = Maybe [TopicPreference]
a} :: GetContactResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A boolean value status noting if the contact is unsubscribed from all
-- contact list topics.
getContactResponse_unsubscribeAll :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.Bool)
getContactResponse_unsubscribeAll :: Lens' GetContactResponse (Maybe Bool)
getContactResponse_unsubscribeAll = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactResponse' {Maybe Bool
unsubscribeAll :: Maybe Bool
$sel:unsubscribeAll:GetContactResponse' :: GetContactResponse -> Maybe Bool
unsubscribeAll} -> Maybe Bool
unsubscribeAll) (\s :: GetContactResponse
s@GetContactResponse' {} Maybe Bool
a -> GetContactResponse
s {$sel:unsubscribeAll:GetContactResponse' :: Maybe Bool
unsubscribeAll = Maybe Bool
a} :: GetContactResponse)

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

instance Prelude.NFData GetContactResponse where
  rnf :: GetContactResponse -> ()
rnf GetContactResponse' {Int
Maybe Bool
Maybe [TopicPreference]
Maybe Text
Maybe POSIX
httpStatus :: Int
unsubscribeAll :: Maybe Bool
topicPreferences :: Maybe [TopicPreference]
topicDefaultPreferences :: Maybe [TopicPreference]
lastUpdatedTimestamp :: Maybe POSIX
emailAddress :: Maybe Text
createdTimestamp :: Maybe POSIX
contactListName :: Maybe Text
attributesData :: Maybe Text
$sel:httpStatus:GetContactResponse' :: GetContactResponse -> Int
$sel:unsubscribeAll:GetContactResponse' :: GetContactResponse -> Maybe Bool
$sel:topicPreferences:GetContactResponse' :: GetContactResponse -> Maybe [TopicPreference]
$sel:topicDefaultPreferences:GetContactResponse' :: GetContactResponse -> Maybe [TopicPreference]
$sel:lastUpdatedTimestamp:GetContactResponse' :: GetContactResponse -> Maybe POSIX
$sel:emailAddress:GetContactResponse' :: GetContactResponse -> Maybe Text
$sel:createdTimestamp:GetContactResponse' :: GetContactResponse -> Maybe POSIX
$sel:contactListName:GetContactResponse' :: GetContactResponse -> Maybe Text
$sel:attributesData:GetContactResponse' :: GetContactResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attributesData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactListName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
emailAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTimestamp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TopicPreference]
topicDefaultPreferences
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TopicPreference]
topicPreferences
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
unsubscribeAll
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus