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

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

-- | A ProfileObjectType instance.
--
-- /See:/ 'newListProfileObjectTypeItem' smart constructor.
data ListProfileObjectTypeItem = ListProfileObjectTypeItem'
  { -- | The timestamp of when the domain was most recently edited.
    ListProfileObjectTypeItem -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
    -- | The timestamp of when the domain was created.
    ListProfileObjectTypeItem -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The tags used to organize, track, or control access for this resource.
    ListProfileObjectTypeItem -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the profile object type.
    ListProfileObjectTypeItem -> Text
objectTypeName :: Prelude.Text,
    -- | Description of the profile object type.
    ListProfileObjectTypeItem -> Text
description :: Prelude.Text
  }
  deriving (ListProfileObjectTypeItem -> ListProfileObjectTypeItem -> Bool
(ListProfileObjectTypeItem -> ListProfileObjectTypeItem -> Bool)
-> (ListProfileObjectTypeItem -> ListProfileObjectTypeItem -> Bool)
-> Eq ListProfileObjectTypeItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfileObjectTypeItem -> ListProfileObjectTypeItem -> Bool
$c/= :: ListProfileObjectTypeItem -> ListProfileObjectTypeItem -> Bool
== :: ListProfileObjectTypeItem -> ListProfileObjectTypeItem -> Bool
$c== :: ListProfileObjectTypeItem -> ListProfileObjectTypeItem -> Bool
Prelude.Eq, ReadPrec [ListProfileObjectTypeItem]
ReadPrec ListProfileObjectTypeItem
Int -> ReadS ListProfileObjectTypeItem
ReadS [ListProfileObjectTypeItem]
(Int -> ReadS ListProfileObjectTypeItem)
-> ReadS [ListProfileObjectTypeItem]
-> ReadPrec ListProfileObjectTypeItem
-> ReadPrec [ListProfileObjectTypeItem]
-> Read ListProfileObjectTypeItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfileObjectTypeItem]
$creadListPrec :: ReadPrec [ListProfileObjectTypeItem]
readPrec :: ReadPrec ListProfileObjectTypeItem
$creadPrec :: ReadPrec ListProfileObjectTypeItem
readList :: ReadS [ListProfileObjectTypeItem]
$creadList :: ReadS [ListProfileObjectTypeItem]
readsPrec :: Int -> ReadS ListProfileObjectTypeItem
$creadsPrec :: Int -> ReadS ListProfileObjectTypeItem
Prelude.Read, Int -> ListProfileObjectTypeItem -> ShowS
[ListProfileObjectTypeItem] -> ShowS
ListProfileObjectTypeItem -> String
(Int -> ListProfileObjectTypeItem -> ShowS)
-> (ListProfileObjectTypeItem -> String)
-> ([ListProfileObjectTypeItem] -> ShowS)
-> Show ListProfileObjectTypeItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfileObjectTypeItem] -> ShowS
$cshowList :: [ListProfileObjectTypeItem] -> ShowS
show :: ListProfileObjectTypeItem -> String
$cshow :: ListProfileObjectTypeItem -> String
showsPrec :: Int -> ListProfileObjectTypeItem -> ShowS
$cshowsPrec :: Int -> ListProfileObjectTypeItem -> ShowS
Prelude.Show, (forall x.
 ListProfileObjectTypeItem -> Rep ListProfileObjectTypeItem x)
-> (forall x.
    Rep ListProfileObjectTypeItem x -> ListProfileObjectTypeItem)
-> Generic ListProfileObjectTypeItem
forall x.
Rep ListProfileObjectTypeItem x -> ListProfileObjectTypeItem
forall x.
ListProfileObjectTypeItem -> Rep ListProfileObjectTypeItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProfileObjectTypeItem x -> ListProfileObjectTypeItem
$cfrom :: forall x.
ListProfileObjectTypeItem -> Rep ListProfileObjectTypeItem x
Prelude.Generic)

-- |
-- Create a value of 'ListProfileObjectTypeItem' 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:
--
-- 'lastUpdatedAt', 'listProfileObjectTypeItem_lastUpdatedAt' - The timestamp of when the domain was most recently edited.
--
-- 'createdAt', 'listProfileObjectTypeItem_createdAt' - The timestamp of when the domain was created.
--
-- 'tags', 'listProfileObjectTypeItem_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'objectTypeName', 'listProfileObjectTypeItem_objectTypeName' - The name of the profile object type.
--
-- 'description', 'listProfileObjectTypeItem_description' - Description of the profile object type.
newListProfileObjectTypeItem ::
  -- | 'objectTypeName'
  Prelude.Text ->
  -- | 'description'
  Prelude.Text ->
  ListProfileObjectTypeItem
newListProfileObjectTypeItem :: Text -> Text -> ListProfileObjectTypeItem
newListProfileObjectTypeItem
  Text
pObjectTypeName_
  Text
pDescription_ =
    ListProfileObjectTypeItem' :: Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> ListProfileObjectTypeItem
ListProfileObjectTypeItem'
      { $sel:lastUpdatedAt:ListProfileObjectTypeItem' :: Maybe POSIX
lastUpdatedAt =
          Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:createdAt:ListProfileObjectTypeItem' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ListProfileObjectTypeItem' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:objectTypeName:ListProfileObjectTypeItem' :: Text
objectTypeName = Text
pObjectTypeName_,
        $sel:description:ListProfileObjectTypeItem' :: Text
description = Text
pDescription_
      }

-- | The timestamp of when the domain was most recently edited.
listProfileObjectTypeItem_lastUpdatedAt :: Lens.Lens' ListProfileObjectTypeItem (Prelude.Maybe Prelude.UTCTime)
listProfileObjectTypeItem_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem
listProfileObjectTypeItem_lastUpdatedAt = (ListProfileObjectTypeItem -> Maybe POSIX)
-> (ListProfileObjectTypeItem
    -> Maybe POSIX -> ListProfileObjectTypeItem)
-> Lens
     ListProfileObjectTypeItem
     ListProfileObjectTypeItem
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeItem' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: ListProfileObjectTypeItem
s@ListProfileObjectTypeItem' {} Maybe POSIX
a -> ListProfileObjectTypeItem
s {$sel:lastUpdatedAt:ListProfileObjectTypeItem' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: ListProfileObjectTypeItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListProfileObjectTypeItem
-> f ListProfileObjectTypeItem
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 timestamp of when the domain was created.
listProfileObjectTypeItem_createdAt :: Lens.Lens' ListProfileObjectTypeItem (Prelude.Maybe Prelude.UTCTime)
listProfileObjectTypeItem_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem
listProfileObjectTypeItem_createdAt = (ListProfileObjectTypeItem -> Maybe POSIX)
-> (ListProfileObjectTypeItem
    -> Maybe POSIX -> ListProfileObjectTypeItem)
-> Lens
     ListProfileObjectTypeItem
     ListProfileObjectTypeItem
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeItem' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ListProfileObjectTypeItem
s@ListProfileObjectTypeItem' {} Maybe POSIX
a -> ListProfileObjectTypeItem
s {$sel:createdAt:ListProfileObjectTypeItem' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ListProfileObjectTypeItem) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListProfileObjectTypeItem
-> f ListProfileObjectTypeItem
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 tags used to organize, track, or control access for this resource.
listProfileObjectTypeItem_tags :: Lens.Lens' ListProfileObjectTypeItem (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
listProfileObjectTypeItem_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem
listProfileObjectTypeItem_tags = (ListProfileObjectTypeItem -> Maybe (HashMap Text Text))
-> (ListProfileObjectTypeItem
    -> Maybe (HashMap Text Text) -> ListProfileObjectTypeItem)
-> Lens
     ListProfileObjectTypeItem
     ListProfileObjectTypeItem
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeItem' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ListProfileObjectTypeItem
s@ListProfileObjectTypeItem' {} Maybe (HashMap Text Text)
a -> ListProfileObjectTypeItem
s {$sel:tags:ListProfileObjectTypeItem' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ListProfileObjectTypeItem) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListProfileObjectTypeItem
-> f ListProfileObjectTypeItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the profile object type.
listProfileObjectTypeItem_objectTypeName :: Lens.Lens' ListProfileObjectTypeItem Prelude.Text
listProfileObjectTypeItem_objectTypeName :: (Text -> f Text)
-> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem
listProfileObjectTypeItem_objectTypeName = (ListProfileObjectTypeItem -> Text)
-> (ListProfileObjectTypeItem -> Text -> ListProfileObjectTypeItem)
-> Lens
     ListProfileObjectTypeItem ListProfileObjectTypeItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeItem' {Text
objectTypeName :: Text
$sel:objectTypeName:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Text
objectTypeName} -> Text
objectTypeName) (\s :: ListProfileObjectTypeItem
s@ListProfileObjectTypeItem' {} Text
a -> ListProfileObjectTypeItem
s {$sel:objectTypeName:ListProfileObjectTypeItem' :: Text
objectTypeName = Text
a} :: ListProfileObjectTypeItem)

-- | Description of the profile object type.
listProfileObjectTypeItem_description :: Lens.Lens' ListProfileObjectTypeItem Prelude.Text
listProfileObjectTypeItem_description :: (Text -> f Text)
-> ListProfileObjectTypeItem -> f ListProfileObjectTypeItem
listProfileObjectTypeItem_description = (ListProfileObjectTypeItem -> Text)
-> (ListProfileObjectTypeItem -> Text -> ListProfileObjectTypeItem)
-> Lens
     ListProfileObjectTypeItem ListProfileObjectTypeItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypeItem' {Text
description :: Text
$sel:description:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Text
description} -> Text
description) (\s :: ListProfileObjectTypeItem
s@ListProfileObjectTypeItem' {} Text
a -> ListProfileObjectTypeItem
s {$sel:description:ListProfileObjectTypeItem' :: Text
description = Text
a} :: ListProfileObjectTypeItem)

instance Core.FromJSON ListProfileObjectTypeItem where
  parseJSON :: Value -> Parser ListProfileObjectTypeItem
parseJSON =
    String
-> (Object -> Parser ListProfileObjectTypeItem)
-> Value
-> Parser ListProfileObjectTypeItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListProfileObjectTypeItem"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> ListProfileObjectTypeItem
ListProfileObjectTypeItem'
            (Maybe POSIX
 -> Maybe POSIX
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> ListProfileObjectTypeItem)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe POSIX
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> ListProfileObjectTypeItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdatedAt")
            Parser
  (Maybe POSIX
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> ListProfileObjectTypeItem)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text -> Text -> ListProfileObjectTypeItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
            Parser
  (Maybe (HashMap Text Text)
   -> Text -> Text -> ListProfileObjectTypeItem)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> ListProfileObjectTypeItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> Text -> ListProfileObjectTypeItem)
-> Parser Text -> Parser (Text -> ListProfileObjectTypeItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ObjectTypeName")
            Parser (Text -> ListProfileObjectTypeItem)
-> Parser Text -> Parser ListProfileObjectTypeItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Description")
      )

instance Prelude.Hashable ListProfileObjectTypeItem

instance Prelude.NFData ListProfileObjectTypeItem