{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CustomerProfiles.Types.ListProfileObjectTypeItem 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

-- | A ProfileObjectType instance.
--
-- /See:/ 'newListProfileObjectTypeItem' smart constructor.
data ListProfileObjectTypeItem = ListProfileObjectTypeItem'
  { -- | The timestamp of when the domain was created.
    ListProfileObjectTypeItem -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The timestamp of when the domain was most recently edited.
    ListProfileObjectTypeItem -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Data.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
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]
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
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.
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:
--
-- 'createdAt', 'listProfileObjectTypeItem_createdAt' - The timestamp of when the domain was created.
--
-- 'lastUpdatedAt', 'listProfileObjectTypeItem_lastUpdatedAt' - The timestamp of when the domain was most recently edited.
--
-- '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'
      { $sel:createdAt:ListProfileObjectTypeItem' :: Maybe POSIX
createdAt =
          forall a. Maybe a
Prelude.Nothing,
        $sel:lastUpdatedAt:ListProfileObjectTypeItem' :: Maybe POSIX
lastUpdatedAt = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ListProfileObjectTypeItem' :: Maybe (HashMap Text Text)
tags = 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 created.
listProfileObjectTypeItem_createdAt :: Lens.Lens' ListProfileObjectTypeItem (Prelude.Maybe Prelude.UTCTime)
listProfileObjectTypeItem_createdAt :: Lens' ListProfileObjectTypeItem (Maybe UTCTime)
listProfileObjectTypeItem_createdAt = 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) 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 timestamp of when the domain was most recently edited.
listProfileObjectTypeItem_lastUpdatedAt :: Lens.Lens' ListProfileObjectTypeItem (Prelude.Maybe Prelude.UTCTime)
listProfileObjectTypeItem_lastUpdatedAt :: Lens' ListProfileObjectTypeItem (Maybe UTCTime)
listProfileObjectTypeItem_lastUpdatedAt = 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) 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 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 :: Lens' ListProfileObjectTypeItem (Maybe (HashMap Text Text))
listProfileObjectTypeItem_tags = 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) 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 name of the profile object type.
listProfileObjectTypeItem_objectTypeName :: Lens.Lens' ListProfileObjectTypeItem Prelude.Text
listProfileObjectTypeItem_objectTypeName :: Lens' ListProfileObjectTypeItem Text
listProfileObjectTypeItem_objectTypeName = 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 :: Lens' ListProfileObjectTypeItem Text
listProfileObjectTypeItem_description = 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 Data.FromJSON ListProfileObjectTypeItem where
  parseJSON :: Value -> Parser ListProfileObjectTypeItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListProfileObjectTypeItem"
      ( \Object
x ->
          Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> ListProfileObjectTypeItem
ListProfileObjectTypeItem'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreatedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LastUpdatedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= 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 -> Parser a
Data..: Key
"ObjectTypeName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Description")
      )

instance Prelude.Hashable ListProfileObjectTypeItem where
  hashWithSalt :: Int -> ListProfileObjectTypeItem -> Int
hashWithSalt Int
_salt ListProfileObjectTypeItem' {Maybe (HashMap Text Text)
Maybe POSIX
Text
description :: Text
objectTypeName :: Text
tags :: Maybe (HashMap Text Text)
lastUpdatedAt :: Maybe POSIX
createdAt :: Maybe POSIX
$sel:description:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Text
$sel:objectTypeName:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Text
$sel:tags:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe (HashMap Text Text)
$sel:lastUpdatedAt:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe POSIX
$sel:createdAt:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
objectTypeName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
description

instance Prelude.NFData ListProfileObjectTypeItem where
  rnf :: ListProfileObjectTypeItem -> ()
rnf ListProfileObjectTypeItem' {Maybe (HashMap Text Text)
Maybe POSIX
Text
description :: Text
objectTypeName :: Text
tags :: Maybe (HashMap Text Text)
lastUpdatedAt :: Maybe POSIX
createdAt :: Maybe POSIX
$sel:description:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Text
$sel:objectTypeName:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Text
$sel:tags:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe (HashMap Text Text)
$sel:lastUpdatedAt:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe POSIX
$sel:createdAt:ListProfileObjectTypeItem' :: ListProfileObjectTypeItem -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
objectTypeName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
description