{-# 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.ListProfileObjectTypeTemplateItem
-- 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.ListProfileObjectTypeTemplateItem where

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

-- | A ProfileObjectTypeTemplate in a list of ProfileObjectTypeTemplates.
--
-- /See:/ 'newListProfileObjectTypeTemplateItem' smart constructor.
data ListProfileObjectTypeTemplateItem = ListProfileObjectTypeTemplateItem'
  { -- | The name of the source of the object template.
    ListProfileObjectTypeTemplateItem -> Maybe Text
sourceName :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the object template.
    ListProfileObjectTypeTemplateItem -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
    -- | The source of the object template.
    ListProfileObjectTypeTemplateItem -> Maybe Text
sourceObject :: Prelude.Maybe Prelude.Text
  }
  deriving (ListProfileObjectTypeTemplateItem
-> ListProfileObjectTypeTemplateItem -> Bool
(ListProfileObjectTypeTemplateItem
 -> ListProfileObjectTypeTemplateItem -> Bool)
-> (ListProfileObjectTypeTemplateItem
    -> ListProfileObjectTypeTemplateItem -> Bool)
-> Eq ListProfileObjectTypeTemplateItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfileObjectTypeTemplateItem
-> ListProfileObjectTypeTemplateItem -> Bool
$c/= :: ListProfileObjectTypeTemplateItem
-> ListProfileObjectTypeTemplateItem -> Bool
== :: ListProfileObjectTypeTemplateItem
-> ListProfileObjectTypeTemplateItem -> Bool
$c== :: ListProfileObjectTypeTemplateItem
-> ListProfileObjectTypeTemplateItem -> Bool
Prelude.Eq, ReadPrec [ListProfileObjectTypeTemplateItem]
ReadPrec ListProfileObjectTypeTemplateItem
Int -> ReadS ListProfileObjectTypeTemplateItem
ReadS [ListProfileObjectTypeTemplateItem]
(Int -> ReadS ListProfileObjectTypeTemplateItem)
-> ReadS [ListProfileObjectTypeTemplateItem]
-> ReadPrec ListProfileObjectTypeTemplateItem
-> ReadPrec [ListProfileObjectTypeTemplateItem]
-> Read ListProfileObjectTypeTemplateItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfileObjectTypeTemplateItem]
$creadListPrec :: ReadPrec [ListProfileObjectTypeTemplateItem]
readPrec :: ReadPrec ListProfileObjectTypeTemplateItem
$creadPrec :: ReadPrec ListProfileObjectTypeTemplateItem
readList :: ReadS [ListProfileObjectTypeTemplateItem]
$creadList :: ReadS [ListProfileObjectTypeTemplateItem]
readsPrec :: Int -> ReadS ListProfileObjectTypeTemplateItem
$creadsPrec :: Int -> ReadS ListProfileObjectTypeTemplateItem
Prelude.Read, Int -> ListProfileObjectTypeTemplateItem -> ShowS
[ListProfileObjectTypeTemplateItem] -> ShowS
ListProfileObjectTypeTemplateItem -> String
(Int -> ListProfileObjectTypeTemplateItem -> ShowS)
-> (ListProfileObjectTypeTemplateItem -> String)
-> ([ListProfileObjectTypeTemplateItem] -> ShowS)
-> Show ListProfileObjectTypeTemplateItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfileObjectTypeTemplateItem] -> ShowS
$cshowList :: [ListProfileObjectTypeTemplateItem] -> ShowS
show :: ListProfileObjectTypeTemplateItem -> String
$cshow :: ListProfileObjectTypeTemplateItem -> String
showsPrec :: Int -> ListProfileObjectTypeTemplateItem -> ShowS
$cshowsPrec :: Int -> ListProfileObjectTypeTemplateItem -> ShowS
Prelude.Show, (forall x.
 ListProfileObjectTypeTemplateItem
 -> Rep ListProfileObjectTypeTemplateItem x)
-> (forall x.
    Rep ListProfileObjectTypeTemplateItem x
    -> ListProfileObjectTypeTemplateItem)
-> Generic ListProfileObjectTypeTemplateItem
forall x.
Rep ListProfileObjectTypeTemplateItem x
-> ListProfileObjectTypeTemplateItem
forall x.
ListProfileObjectTypeTemplateItem
-> Rep ListProfileObjectTypeTemplateItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProfileObjectTypeTemplateItem x
-> ListProfileObjectTypeTemplateItem
$cfrom :: forall x.
ListProfileObjectTypeTemplateItem
-> Rep ListProfileObjectTypeTemplateItem x
Prelude.Generic)

-- |
-- Create a value of 'ListProfileObjectTypeTemplateItem' 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:
--
-- 'sourceName', 'listProfileObjectTypeTemplateItem_sourceName' - The name of the source of the object template.
--
-- 'templateId', 'listProfileObjectTypeTemplateItem_templateId' - A unique identifier for the object template.
--
-- 'sourceObject', 'listProfileObjectTypeTemplateItem_sourceObject' - The source of the object template.
newListProfileObjectTypeTemplateItem ::
  ListProfileObjectTypeTemplateItem
newListProfileObjectTypeTemplateItem :: ListProfileObjectTypeTemplateItem
newListProfileObjectTypeTemplateItem =
  ListProfileObjectTypeTemplateItem' :: Maybe Text
-> Maybe Text -> Maybe Text -> ListProfileObjectTypeTemplateItem
ListProfileObjectTypeTemplateItem'
    { $sel:sourceName:ListProfileObjectTypeTemplateItem' :: Maybe Text
sourceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateId:ListProfileObjectTypeTemplateItem' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceObject:ListProfileObjectTypeTemplateItem' :: Maybe Text
sourceObject = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the source of the object template.
listProfileObjectTypeTemplateItem_sourceName :: Lens.Lens' ListProfileObjectTypeTemplateItem (Prelude.Maybe Prelude.Text)
listProfileObjectTypeTemplateItem_sourceName :: (Maybe Text -> f (Maybe Text))
-> ListProfileObjectTypeTemplateItem
-> f ListProfileObjectTypeTemplateItem
listProfileObjectTypeTemplateItem_sourceName = (ListProfileObjectTypeTemplateItem -> Maybe Text)
-> (ListProfileObjectTypeTemplateItem
    -> Maybe Text -> ListProfileObjectTypeTemplateItem)
-> Lens
     ListProfileObjectTypeTemplateItem
     ListProfileObjectTypeTemplateItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeTemplateItem' {Maybe Text
sourceName :: Maybe Text
$sel:sourceName:ListProfileObjectTypeTemplateItem' :: ListProfileObjectTypeTemplateItem -> Maybe Text
sourceName} -> Maybe Text
sourceName) (\s :: ListProfileObjectTypeTemplateItem
s@ListProfileObjectTypeTemplateItem' {} Maybe Text
a -> ListProfileObjectTypeTemplateItem
s {$sel:sourceName:ListProfileObjectTypeTemplateItem' :: Maybe Text
sourceName = Maybe Text
a} :: ListProfileObjectTypeTemplateItem)

-- | A unique identifier for the object template.
listProfileObjectTypeTemplateItem_templateId :: Lens.Lens' ListProfileObjectTypeTemplateItem (Prelude.Maybe Prelude.Text)
listProfileObjectTypeTemplateItem_templateId :: (Maybe Text -> f (Maybe Text))
-> ListProfileObjectTypeTemplateItem
-> f ListProfileObjectTypeTemplateItem
listProfileObjectTypeTemplateItem_templateId = (ListProfileObjectTypeTemplateItem -> Maybe Text)
-> (ListProfileObjectTypeTemplateItem
    -> Maybe Text -> ListProfileObjectTypeTemplateItem)
-> Lens
     ListProfileObjectTypeTemplateItem
     ListProfileObjectTypeTemplateItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeTemplateItem' {Maybe Text
templateId :: Maybe Text
$sel:templateId:ListProfileObjectTypeTemplateItem' :: ListProfileObjectTypeTemplateItem -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: ListProfileObjectTypeTemplateItem
s@ListProfileObjectTypeTemplateItem' {} Maybe Text
a -> ListProfileObjectTypeTemplateItem
s {$sel:templateId:ListProfileObjectTypeTemplateItem' :: Maybe Text
templateId = Maybe Text
a} :: ListProfileObjectTypeTemplateItem)

-- | The source of the object template.
listProfileObjectTypeTemplateItem_sourceObject :: Lens.Lens' ListProfileObjectTypeTemplateItem (Prelude.Maybe Prelude.Text)
listProfileObjectTypeTemplateItem_sourceObject :: (Maybe Text -> f (Maybe Text))
-> ListProfileObjectTypeTemplateItem
-> f ListProfileObjectTypeTemplateItem
listProfileObjectTypeTemplateItem_sourceObject = (ListProfileObjectTypeTemplateItem -> Maybe Text)
-> (ListProfileObjectTypeTemplateItem
    -> Maybe Text -> ListProfileObjectTypeTemplateItem)
-> Lens
     ListProfileObjectTypeTemplateItem
     ListProfileObjectTypeTemplateItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeTemplateItem' {Maybe Text
sourceObject :: Maybe Text
$sel:sourceObject:ListProfileObjectTypeTemplateItem' :: ListProfileObjectTypeTemplateItem -> Maybe Text
sourceObject} -> Maybe Text
sourceObject) (\s :: ListProfileObjectTypeTemplateItem
s@ListProfileObjectTypeTemplateItem' {} Maybe Text
a -> ListProfileObjectTypeTemplateItem
s {$sel:sourceObject:ListProfileObjectTypeTemplateItem' :: Maybe Text
sourceObject = Maybe Text
a} :: ListProfileObjectTypeTemplateItem)

instance
  Core.FromJSON
    ListProfileObjectTypeTemplateItem
  where
  parseJSON :: Value -> Parser ListProfileObjectTypeTemplateItem
parseJSON =
    String
-> (Object -> Parser ListProfileObjectTypeTemplateItem)
-> Value
-> Parser ListProfileObjectTypeTemplateItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListProfileObjectTypeTemplateItem"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> ListProfileObjectTypeTemplateItem
ListProfileObjectTypeTemplateItem'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> ListProfileObjectTypeTemplateItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> ListProfileObjectTypeTemplateItem)
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
"SourceName")
            Parser
  (Maybe Text -> Maybe Text -> ListProfileObjectTypeTemplateItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ListProfileObjectTypeTemplateItem)
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
"TemplateId")
            Parser (Maybe Text -> ListProfileObjectTypeTemplateItem)
-> Parser (Maybe Text) -> Parser ListProfileObjectTypeTemplateItem
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
"SourceObject")
      )

instance
  Prelude.Hashable
    ListProfileObjectTypeTemplateItem

instance
  Prelude.NFData
    ListProfileObjectTypeTemplateItem