{-# 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-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)
--
-- 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_unsubscribeAll,
    getContactResponse_attributesData,
    getContactResponse_topicDefaultPreferences,
    getContactResponse_emailAddress,
    getContactResponse_contactListName,
    getContactResponse_createdTimestamp,
    getContactResponse_lastUpdatedTimestamp,
    getContactResponse_topicPreferences,
    getContactResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(GetContact -> GetContact -> Bool)
-> (GetContact -> GetContact -> Bool) -> Eq GetContact
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]
(Int -> ReadS GetContact)
-> ReadS [GetContact]
-> ReadPrec GetContact
-> ReadPrec [GetContact]
-> Read 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
(Int -> GetContact -> ShowS)
-> (GetContact -> String)
-> ([GetContact] -> ShowS)
-> Show GetContact
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. GetContact -> Rep GetContact x)
-> (forall x. Rep GetContact x -> GetContact) -> Generic GetContact
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' :: Text -> Text -> GetContact
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 :: (Text -> f Text) -> GetContact -> f GetContact
getContact_contactListName = (GetContact -> Text)
-> (GetContact -> Text -> GetContact)
-> Lens GetContact GetContact Text Text
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 :: (Text -> f Text) -> GetContact -> f GetContact
getContact_emailAddress = (GetContact -> Text)
-> (GetContact -> Text -> GetContact)
-> Lens GetContact GetContact Text Text
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 :: GetContact -> Request GetContact
request = Service -> GetContact -> Request GetContact
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetContact)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetContact))
-> Logger
-> Service
-> Proxy GetContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetContact)))
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 Bool
-> Maybe Text
-> Maybe [TopicPreference]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe [TopicPreference]
-> Int
-> GetContactResponse
GetContactResponse'
            (Maybe Bool
 -> Maybe Text
 -> Maybe [TopicPreference]
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe [TopicPreference]
 -> Int
 -> GetContactResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe [TopicPreference]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe [TopicPreference]
      -> Int
      -> GetContactResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UnsubscribeAll")
            Either
  String
  (Maybe Text
   -> Maybe [TopicPreference]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe [TopicPreference]
   -> Int
   -> GetContactResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [TopicPreference]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe [TopicPreference]
      -> Int
      -> GetContactResponse)
forall (f :: * -> *) a b. Applicative f => 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
"AttributesData")
            Either
  String
  (Maybe [TopicPreference]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe [TopicPreference]
   -> Int
   -> GetContactResponse)
-> Either String (Maybe [TopicPreference])
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe [TopicPreference]
      -> Int
      -> GetContactResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [TopicPreference]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TopicDefaultPreferences"
                            Either String (Maybe (Maybe [TopicPreference]))
-> Maybe [TopicPreference]
-> Either String (Maybe [TopicPreference])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TopicPreference]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe [TopicPreference]
   -> Int
   -> GetContactResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe [TopicPreference]
      -> Int
      -> GetContactResponse)
forall (f :: * -> *) a b. Applicative f => 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
"EmailAddress")
            Either
  String
  (Maybe Text
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe [TopicPreference]
   -> Int
   -> GetContactResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX
      -> Maybe POSIX
      -> Maybe [TopicPreference]
      -> Int
      -> GetContactResponse)
forall (f :: * -> *) a b. Applicative f => 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
"ContactListName")
            Either
  String
  (Maybe POSIX
   -> Maybe POSIX
   -> Maybe [TopicPreference]
   -> Int
   -> GetContactResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe POSIX
      -> Maybe [TopicPreference] -> Int -> GetContactResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreatedTimestamp")
            Either
  String
  (Maybe POSIX
   -> Maybe [TopicPreference] -> Int -> GetContactResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe [TopicPreference] -> Int -> GetContactResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LastUpdatedTimestamp")
            Either
  String (Maybe [TopicPreference] -> Int -> GetContactResponse)
-> Either String (Maybe [TopicPreference])
-> Either String (Int -> GetContactResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [TopicPreference]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TopicPreferences"
                            Either String (Maybe (Maybe [TopicPreference]))
-> Maybe [TopicPreference]
-> Either String (Maybe [TopicPreference])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TopicPreference]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> GetContactResponse)
-> Either String Int -> Either String GetContactResponse
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 GetContact

instance Prelude.NFData GetContact

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

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

-- | /See:/ 'newGetContactResponse' smart constructor.
data GetContactResponse = GetContactResponse'
  { -- | A boolean value status noting if the contact is unsubscribed from all
    -- contact list topics.
    GetContactResponse -> Maybe Bool
unsubscribeAll :: Prelude.Maybe Prelude.Bool,
    -- | The attribute data attached to a contact.
    GetContactResponse -> Maybe Text
attributesData :: Prelude.Maybe Prelude.Text,
    -- | The default topic preferences applied to the contact.
    GetContactResponse -> Maybe [TopicPreference]
topicDefaultPreferences :: Prelude.Maybe [TopicPreference],
    -- | The contact\'s email addres.
    GetContactResponse -> Maybe Text
emailAddress :: 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 Core.POSIX,
    -- | A timestamp noting the last time the contact\'s information was updated.
    GetContactResponse -> Maybe POSIX
lastUpdatedTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The contact\'s preference for being opted-in to or opted-out of a
    -- topic.>
    GetContactResponse -> Maybe [TopicPreference]
topicPreferences :: Prelude.Maybe [TopicPreference],
    -- | The response's http status code.
    GetContactResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetContactResponse -> GetContactResponse -> Bool
(GetContactResponse -> GetContactResponse -> Bool)
-> (GetContactResponse -> GetContactResponse -> Bool)
-> Eq GetContactResponse
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]
(Int -> ReadS GetContactResponse)
-> ReadS [GetContactResponse]
-> ReadPrec GetContactResponse
-> ReadPrec [GetContactResponse]
-> Read 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
(Int -> GetContactResponse -> ShowS)
-> (GetContactResponse -> String)
-> ([GetContactResponse] -> ShowS)
-> Show GetContactResponse
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. GetContactResponse -> Rep GetContactResponse x)
-> (forall x. Rep GetContactResponse x -> GetContactResponse)
-> Generic GetContactResponse
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:
--
-- 'unsubscribeAll', 'getContactResponse_unsubscribeAll' - A boolean value status noting if the contact is unsubscribed from all
-- contact list topics.
--
-- 'attributesData', 'getContactResponse_attributesData' - The attribute data attached to a contact.
--
-- 'topicDefaultPreferences', 'getContactResponse_topicDefaultPreferences' - The default topic preferences applied to the contact.
--
-- 'emailAddress', 'getContactResponse_emailAddress' - The contact\'s email addres.
--
-- '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.
--
-- 'lastUpdatedTimestamp', 'getContactResponse_lastUpdatedTimestamp' - A timestamp noting the last time the contact\'s information was updated.
--
-- 'topicPreferences', 'getContactResponse_topicPreferences' - The contact\'s preference for being opted-in to or opted-out of a
-- topic.>
--
-- 'httpStatus', 'getContactResponse_httpStatus' - The response's http status code.
newGetContactResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetContactResponse
newGetContactResponse :: Int -> GetContactResponse
newGetContactResponse Int
pHttpStatus_ =
  GetContactResponse' :: Maybe Bool
-> Maybe Text
-> Maybe [TopicPreference]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe [TopicPreference]
-> Int
-> GetContactResponse
GetContactResponse'
    { $sel:unsubscribeAll:GetContactResponse' :: Maybe Bool
unsubscribeAll =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:attributesData:GetContactResponse' :: Maybe Text
attributesData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:topicDefaultPreferences:GetContactResponse' :: Maybe [TopicPreference]
topicDefaultPreferences = Maybe [TopicPreference]
forall a. Maybe a
Prelude.Nothing,
      $sel:emailAddress:GetContactResponse' :: Maybe Text
emailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contactListName:GetContactResponse' :: Maybe Text
contactListName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTimestamp:GetContactResponse' :: Maybe POSIX
createdTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTimestamp:GetContactResponse' :: Maybe POSIX
lastUpdatedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:topicPreferences:GetContactResponse' :: Maybe [TopicPreference]
topicPreferences = Maybe [TopicPreference]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetContactResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> GetContactResponse -> f GetContactResponse
getContactResponse_unsubscribeAll = (GetContactResponse -> Maybe Bool)
-> (GetContactResponse -> Maybe Bool -> GetContactResponse)
-> Lens
     GetContactResponse GetContactResponse (Maybe Bool) (Maybe Bool)
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 attribute data attached to a contact.
getContactResponse_attributesData :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.Text)
getContactResponse_attributesData :: (Maybe Text -> f (Maybe Text))
-> GetContactResponse -> f GetContactResponse
getContactResponse_attributesData = (GetContactResponse -> Maybe Text)
-> (GetContactResponse -> Maybe Text -> GetContactResponse)
-> Lens
     GetContactResponse GetContactResponse (Maybe Text) (Maybe Text)
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 default topic preferences applied to the contact.
getContactResponse_topicDefaultPreferences :: Lens.Lens' GetContactResponse (Prelude.Maybe [TopicPreference])
getContactResponse_topicDefaultPreferences :: (Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
-> GetContactResponse -> f GetContactResponse
getContactResponse_topicDefaultPreferences = (GetContactResponse -> Maybe [TopicPreference])
-> (GetContactResponse
    -> Maybe [TopicPreference] -> GetContactResponse)
-> Lens
     GetContactResponse
     GetContactResponse
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
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) ((Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
 -> GetContactResponse -> f GetContactResponse)
-> ((Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
    -> Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
-> (Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
-> GetContactResponse
-> f GetContactResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
-> Iso
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
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 AnIso
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The contact\'s email addres.
getContactResponse_emailAddress :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.Text)
getContactResponse_emailAddress :: (Maybe Text -> f (Maybe Text))
-> GetContactResponse -> f GetContactResponse
getContactResponse_emailAddress = (GetContactResponse -> Maybe Text)
-> (GetContactResponse -> Maybe Text -> GetContactResponse)
-> Lens
     GetContactResponse GetContactResponse (Maybe Text) (Maybe Text)
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)

-- | The name of the contact list to which the contact belongs.
getContactResponse_contactListName :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.Text)
getContactResponse_contactListName :: (Maybe Text -> f (Maybe Text))
-> GetContactResponse -> f GetContactResponse
getContactResponse_contactListName = (GetContactResponse -> Maybe Text)
-> (GetContactResponse -> Maybe Text -> GetContactResponse)
-> Lens
     GetContactResponse GetContactResponse (Maybe Text) (Maybe Text)
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 :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetContactResponse -> f GetContactResponse
getContactResponse_createdTimestamp = (GetContactResponse -> Maybe POSIX)
-> (GetContactResponse -> Maybe POSIX -> GetContactResponse)
-> Lens
     GetContactResponse GetContactResponse (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetContactResponse -> f GetContactResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetContactResponse
-> f GetContactResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A timestamp noting the last time the contact\'s information was updated.
getContactResponse_lastUpdatedTimestamp :: Lens.Lens' GetContactResponse (Prelude.Maybe Prelude.UTCTime)
getContactResponse_lastUpdatedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetContactResponse -> f GetContactResponse
getContactResponse_lastUpdatedTimestamp = (GetContactResponse -> Maybe POSIX)
-> (GetContactResponse -> Maybe POSIX -> GetContactResponse)
-> Lens
     GetContactResponse GetContactResponse (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetContactResponse -> f GetContactResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetContactResponse
-> f GetContactResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | 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 :: (Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
-> GetContactResponse -> f GetContactResponse
getContactResponse_topicPreferences = (GetContactResponse -> Maybe [TopicPreference])
-> (GetContactResponse
    -> Maybe [TopicPreference] -> GetContactResponse)
-> Lens
     GetContactResponse
     GetContactResponse
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
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) ((Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
 -> GetContactResponse -> f GetContactResponse)
-> ((Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
    -> Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
-> (Maybe [TopicPreference] -> f (Maybe [TopicPreference]))
-> GetContactResponse
-> f GetContactResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
-> Iso
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
     (Maybe [TopicPreference])
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 AnIso
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
  [TopicPreference]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
getContactResponse_httpStatus :: Lens.Lens' GetContactResponse Prelude.Int
getContactResponse_httpStatus :: (Int -> f Int) -> GetContactResponse -> f GetContactResponse
getContactResponse_httpStatus = (GetContactResponse -> Int)
-> (GetContactResponse -> Int -> GetContactResponse)
-> Lens GetContactResponse GetContactResponse Int Int
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