{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CustomerProfiles.Types.ListProfileObjectsItem
-- 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)
module Amazonka.CustomerProfiles.Types.ListProfileObjectsItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A ProfileObject in a list of ProfileObjects.
--
-- /See:/ 'newListProfileObjectsItem' smart constructor.
data ListProfileObjectsItem = ListProfileObjectsItem'
  { -- | The unique identifier of the ProfileObject generated by the service.
    ListProfileObjectsItem -> Maybe Text
profileObjectUniqueKey :: Prelude.Maybe Prelude.Text,
    -- | Specifies the kind of object being added to a profile, such as
    -- \"Salesforce-Account.\"
    ListProfileObjectsItem -> Maybe Text
objectTypeName :: Prelude.Maybe Prelude.Text,
    -- | A JSON representation of a ProfileObject that belongs to a profile.
    ListProfileObjectsItem -> Maybe Text
object' :: Prelude.Maybe Prelude.Text
  }
  deriving (ListProfileObjectsItem -> ListProfileObjectsItem -> Bool
(ListProfileObjectsItem -> ListProfileObjectsItem -> Bool)
-> (ListProfileObjectsItem -> ListProfileObjectsItem -> Bool)
-> Eq ListProfileObjectsItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfileObjectsItem -> ListProfileObjectsItem -> Bool
$c/= :: ListProfileObjectsItem -> ListProfileObjectsItem -> Bool
== :: ListProfileObjectsItem -> ListProfileObjectsItem -> Bool
$c== :: ListProfileObjectsItem -> ListProfileObjectsItem -> Bool
Prelude.Eq, ReadPrec [ListProfileObjectsItem]
ReadPrec ListProfileObjectsItem
Int -> ReadS ListProfileObjectsItem
ReadS [ListProfileObjectsItem]
(Int -> ReadS ListProfileObjectsItem)
-> ReadS [ListProfileObjectsItem]
-> ReadPrec ListProfileObjectsItem
-> ReadPrec [ListProfileObjectsItem]
-> Read ListProfileObjectsItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfileObjectsItem]
$creadListPrec :: ReadPrec [ListProfileObjectsItem]
readPrec :: ReadPrec ListProfileObjectsItem
$creadPrec :: ReadPrec ListProfileObjectsItem
readList :: ReadS [ListProfileObjectsItem]
$creadList :: ReadS [ListProfileObjectsItem]
readsPrec :: Int -> ReadS ListProfileObjectsItem
$creadsPrec :: Int -> ReadS ListProfileObjectsItem
Prelude.Read, Int -> ListProfileObjectsItem -> ShowS
[ListProfileObjectsItem] -> ShowS
ListProfileObjectsItem -> String
(Int -> ListProfileObjectsItem -> ShowS)
-> (ListProfileObjectsItem -> String)
-> ([ListProfileObjectsItem] -> ShowS)
-> Show ListProfileObjectsItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfileObjectsItem] -> ShowS
$cshowList :: [ListProfileObjectsItem] -> ShowS
show :: ListProfileObjectsItem -> String
$cshow :: ListProfileObjectsItem -> String
showsPrec :: Int -> ListProfileObjectsItem -> ShowS
$cshowsPrec :: Int -> ListProfileObjectsItem -> ShowS
Prelude.Show, (forall x. ListProfileObjectsItem -> Rep ListProfileObjectsItem x)
-> (forall x.
    Rep ListProfileObjectsItem x -> ListProfileObjectsItem)
-> Generic ListProfileObjectsItem
forall x. Rep ListProfileObjectsItem x -> ListProfileObjectsItem
forall x. ListProfileObjectsItem -> Rep ListProfileObjectsItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListProfileObjectsItem x -> ListProfileObjectsItem
$cfrom :: forall x. ListProfileObjectsItem -> Rep ListProfileObjectsItem x
Prelude.Generic)

-- |
-- Create a value of 'ListProfileObjectsItem' 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:
--
-- 'profileObjectUniqueKey', 'listProfileObjectsItem_profileObjectUniqueKey' - The unique identifier of the ProfileObject generated by the service.
--
-- 'objectTypeName', 'listProfileObjectsItem_objectTypeName' - Specifies the kind of object being added to a profile, such as
-- \"Salesforce-Account.\"
--
-- 'object'', 'listProfileObjectsItem_object' - A JSON representation of a ProfileObject that belongs to a profile.
newListProfileObjectsItem ::
  ListProfileObjectsItem
newListProfileObjectsItem :: ListProfileObjectsItem
newListProfileObjectsItem =
  ListProfileObjectsItem' :: Maybe Text -> Maybe Text -> Maybe Text -> ListProfileObjectsItem
ListProfileObjectsItem'
    { $sel:profileObjectUniqueKey:ListProfileObjectsItem' :: Maybe Text
profileObjectUniqueKey =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:objectTypeName:ListProfileObjectsItem' :: Maybe Text
objectTypeName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:object':ListProfileObjectsItem' :: Maybe Text
object' = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier of the ProfileObject generated by the service.
listProfileObjectsItem_profileObjectUniqueKey :: Lens.Lens' ListProfileObjectsItem (Prelude.Maybe Prelude.Text)
listProfileObjectsItem_profileObjectUniqueKey :: (Maybe Text -> f (Maybe Text))
-> ListProfileObjectsItem -> f ListProfileObjectsItem
listProfileObjectsItem_profileObjectUniqueKey = (ListProfileObjectsItem -> Maybe Text)
-> (ListProfileObjectsItem -> Maybe Text -> ListProfileObjectsItem)
-> Lens
     ListProfileObjectsItem
     ListProfileObjectsItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectsItem' {Maybe Text
profileObjectUniqueKey :: Maybe Text
$sel:profileObjectUniqueKey:ListProfileObjectsItem' :: ListProfileObjectsItem -> Maybe Text
profileObjectUniqueKey} -> Maybe Text
profileObjectUniqueKey) (\s :: ListProfileObjectsItem
s@ListProfileObjectsItem' {} Maybe Text
a -> ListProfileObjectsItem
s {$sel:profileObjectUniqueKey:ListProfileObjectsItem' :: Maybe Text
profileObjectUniqueKey = Maybe Text
a} :: ListProfileObjectsItem)

-- | Specifies the kind of object being added to a profile, such as
-- \"Salesforce-Account.\"
listProfileObjectsItem_objectTypeName :: Lens.Lens' ListProfileObjectsItem (Prelude.Maybe Prelude.Text)
listProfileObjectsItem_objectTypeName :: (Maybe Text -> f (Maybe Text))
-> ListProfileObjectsItem -> f ListProfileObjectsItem
listProfileObjectsItem_objectTypeName = (ListProfileObjectsItem -> Maybe Text)
-> (ListProfileObjectsItem -> Maybe Text -> ListProfileObjectsItem)
-> Lens
     ListProfileObjectsItem
     ListProfileObjectsItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectsItem' {Maybe Text
objectTypeName :: Maybe Text
$sel:objectTypeName:ListProfileObjectsItem' :: ListProfileObjectsItem -> Maybe Text
objectTypeName} -> Maybe Text
objectTypeName) (\s :: ListProfileObjectsItem
s@ListProfileObjectsItem' {} Maybe Text
a -> ListProfileObjectsItem
s {$sel:objectTypeName:ListProfileObjectsItem' :: Maybe Text
objectTypeName = Maybe Text
a} :: ListProfileObjectsItem)

-- | A JSON representation of a ProfileObject that belongs to a profile.
listProfileObjectsItem_object :: Lens.Lens' ListProfileObjectsItem (Prelude.Maybe Prelude.Text)
listProfileObjectsItem_object :: (Maybe Text -> f (Maybe Text))
-> ListProfileObjectsItem -> f ListProfileObjectsItem
listProfileObjectsItem_object = (ListProfileObjectsItem -> Maybe Text)
-> (ListProfileObjectsItem -> Maybe Text -> ListProfileObjectsItem)
-> Lens
     ListProfileObjectsItem
     ListProfileObjectsItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectsItem' {Maybe Text
object' :: Maybe Text
$sel:object':ListProfileObjectsItem' :: ListProfileObjectsItem -> Maybe Text
object'} -> Maybe Text
object') (\s :: ListProfileObjectsItem
s@ListProfileObjectsItem' {} Maybe Text
a -> ListProfileObjectsItem
s {$sel:object':ListProfileObjectsItem' :: Maybe Text
object' = Maybe Text
a} :: ListProfileObjectsItem)

instance Core.FromJSON ListProfileObjectsItem where
  parseJSON :: Value -> Parser ListProfileObjectsItem
parseJSON =
    String
-> (Object -> Parser ListProfileObjectsItem)
-> Value
-> Parser ListProfileObjectsItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListProfileObjectsItem"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ListProfileObjectsItem
ListProfileObjectsItem'
            (Maybe Text -> Maybe Text -> Maybe Text -> ListProfileObjectsItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ListProfileObjectsItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProfileObjectUniqueKey")
            Parser (Maybe Text -> Maybe Text -> ListProfileObjectsItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ListProfileObjectsItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ObjectTypeName")
            Parser (Maybe Text -> ListProfileObjectsItem)
-> Parser (Maybe Text) -> Parser ListProfileObjectsItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Object")
      )

instance Prelude.Hashable ListProfileObjectsItem

instance Prelude.NFData ListProfileObjectsItem