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

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

-- | An integration in list of integrations.
--
-- /See:/ 'newListIntegrationItem' smart constructor.
data ListIntegrationItem = ListIntegrationItem'
  { -- | The tags used to organize, track, or control access for this resource.
    ListIntegrationItem -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The unique name of the domain.
    ListIntegrationItem -> Text
domainName :: Prelude.Text,
    -- | The URI of the S3 bucket or any other type of data source.
    ListIntegrationItem -> Text
uri :: Prelude.Text,
    -- | The name of the profile object type.
    ListIntegrationItem -> Text
objectTypeName :: Prelude.Text,
    -- | The timestamp of when the domain was created.
    ListIntegrationItem -> POSIX
createdAt :: Core.POSIX,
    -- | The timestamp of when the domain was most recently edited.
    ListIntegrationItem -> POSIX
lastUpdatedAt :: Core.POSIX
  }
  deriving (ListIntegrationItem -> ListIntegrationItem -> Bool
(ListIntegrationItem -> ListIntegrationItem -> Bool)
-> (ListIntegrationItem -> ListIntegrationItem -> Bool)
-> Eq ListIntegrationItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListIntegrationItem -> ListIntegrationItem -> Bool
$c/= :: ListIntegrationItem -> ListIntegrationItem -> Bool
== :: ListIntegrationItem -> ListIntegrationItem -> Bool
$c== :: ListIntegrationItem -> ListIntegrationItem -> Bool
Prelude.Eq, ReadPrec [ListIntegrationItem]
ReadPrec ListIntegrationItem
Int -> ReadS ListIntegrationItem
ReadS [ListIntegrationItem]
(Int -> ReadS ListIntegrationItem)
-> ReadS [ListIntegrationItem]
-> ReadPrec ListIntegrationItem
-> ReadPrec [ListIntegrationItem]
-> Read ListIntegrationItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListIntegrationItem]
$creadListPrec :: ReadPrec [ListIntegrationItem]
readPrec :: ReadPrec ListIntegrationItem
$creadPrec :: ReadPrec ListIntegrationItem
readList :: ReadS [ListIntegrationItem]
$creadList :: ReadS [ListIntegrationItem]
readsPrec :: Int -> ReadS ListIntegrationItem
$creadsPrec :: Int -> ReadS ListIntegrationItem
Prelude.Read, Int -> ListIntegrationItem -> ShowS
[ListIntegrationItem] -> ShowS
ListIntegrationItem -> String
(Int -> ListIntegrationItem -> ShowS)
-> (ListIntegrationItem -> String)
-> ([ListIntegrationItem] -> ShowS)
-> Show ListIntegrationItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListIntegrationItem] -> ShowS
$cshowList :: [ListIntegrationItem] -> ShowS
show :: ListIntegrationItem -> String
$cshow :: ListIntegrationItem -> String
showsPrec :: Int -> ListIntegrationItem -> ShowS
$cshowsPrec :: Int -> ListIntegrationItem -> ShowS
Prelude.Show, (forall x. ListIntegrationItem -> Rep ListIntegrationItem x)
-> (forall x. Rep ListIntegrationItem x -> ListIntegrationItem)
-> Generic ListIntegrationItem
forall x. Rep ListIntegrationItem x -> ListIntegrationItem
forall x. ListIntegrationItem -> Rep ListIntegrationItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListIntegrationItem x -> ListIntegrationItem
$cfrom :: forall x. ListIntegrationItem -> Rep ListIntegrationItem x
Prelude.Generic)

-- |
-- Create a value of 'ListIntegrationItem' 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:
--
-- 'tags', 'listIntegrationItem_tags' - The tags used to organize, track, or control access for this resource.
--
-- 'domainName', 'listIntegrationItem_domainName' - The unique name of the domain.
--
-- 'uri', 'listIntegrationItem_uri' - The URI of the S3 bucket or any other type of data source.
--
-- 'objectTypeName', 'listIntegrationItem_objectTypeName' - The name of the profile object type.
--
-- 'createdAt', 'listIntegrationItem_createdAt' - The timestamp of when the domain was created.
--
-- 'lastUpdatedAt', 'listIntegrationItem_lastUpdatedAt' - The timestamp of when the domain was most recently edited.
newListIntegrationItem ::
  -- | 'domainName'
  Prelude.Text ->
  -- | 'uri'
  Prelude.Text ->
  -- | 'objectTypeName'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'lastUpdatedAt'
  Prelude.UTCTime ->
  ListIntegrationItem
newListIntegrationItem :: Text -> Text -> Text -> UTCTime -> UTCTime -> ListIntegrationItem
newListIntegrationItem
  Text
pDomainName_
  Text
pUri_
  Text
pObjectTypeName_
  UTCTime
pCreatedAt_
  UTCTime
pLastUpdatedAt_ =
    ListIntegrationItem' :: Maybe (HashMap Text Text)
-> Text -> Text -> Text -> POSIX -> POSIX -> ListIntegrationItem
ListIntegrationItem'
      { $sel:tags:ListIntegrationItem' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:domainName:ListIntegrationItem' :: Text
domainName = Text
pDomainName_,
        $sel:uri:ListIntegrationItem' :: Text
uri = Text
pUri_,
        $sel:objectTypeName:ListIntegrationItem' :: Text
objectTypeName = Text
pObjectTypeName_,
        $sel:createdAt:ListIntegrationItem' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:lastUpdatedAt:ListIntegrationItem' :: POSIX
lastUpdatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastUpdatedAt_
      }

-- | The tags used to organize, track, or control access for this resource.
listIntegrationItem_tags :: Lens.Lens' ListIntegrationItem (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
listIntegrationItem_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ListIntegrationItem -> f ListIntegrationItem
listIntegrationItem_tags = (ListIntegrationItem -> Maybe (HashMap Text Text))
-> (ListIntegrationItem
    -> Maybe (HashMap Text Text) -> ListIntegrationItem)
-> Lens
     ListIntegrationItem
     ListIntegrationItem
     (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 (\ListIntegrationItem' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ListIntegrationItem' :: ListIntegrationItem -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ListIntegrationItem
s@ListIntegrationItem' {} Maybe (HashMap Text Text)
a -> ListIntegrationItem
s {$sel:tags:ListIntegrationItem' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ListIntegrationItem) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ListIntegrationItem -> f ListIntegrationItem)
-> ((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)))
-> ListIntegrationItem
-> f ListIntegrationItem
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 unique name of the domain.
listIntegrationItem_domainName :: Lens.Lens' ListIntegrationItem Prelude.Text
listIntegrationItem_domainName :: (Text -> f Text) -> ListIntegrationItem -> f ListIntegrationItem
listIntegrationItem_domainName = (ListIntegrationItem -> Text)
-> (ListIntegrationItem -> Text -> ListIntegrationItem)
-> Lens ListIntegrationItem ListIntegrationItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationItem' {Text
domainName :: Text
$sel:domainName:ListIntegrationItem' :: ListIntegrationItem -> Text
domainName} -> Text
domainName) (\s :: ListIntegrationItem
s@ListIntegrationItem' {} Text
a -> ListIntegrationItem
s {$sel:domainName:ListIntegrationItem' :: Text
domainName = Text
a} :: ListIntegrationItem)

-- | The URI of the S3 bucket or any other type of data source.
listIntegrationItem_uri :: Lens.Lens' ListIntegrationItem Prelude.Text
listIntegrationItem_uri :: (Text -> f Text) -> ListIntegrationItem -> f ListIntegrationItem
listIntegrationItem_uri = (ListIntegrationItem -> Text)
-> (ListIntegrationItem -> Text -> ListIntegrationItem)
-> Lens ListIntegrationItem ListIntegrationItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationItem' {Text
uri :: Text
$sel:uri:ListIntegrationItem' :: ListIntegrationItem -> Text
uri} -> Text
uri) (\s :: ListIntegrationItem
s@ListIntegrationItem' {} Text
a -> ListIntegrationItem
s {$sel:uri:ListIntegrationItem' :: Text
uri = Text
a} :: ListIntegrationItem)

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

-- | The timestamp of when the domain was created.
listIntegrationItem_createdAt :: Lens.Lens' ListIntegrationItem Prelude.UTCTime
listIntegrationItem_createdAt :: (UTCTime -> f UTCTime)
-> ListIntegrationItem -> f ListIntegrationItem
listIntegrationItem_createdAt = (ListIntegrationItem -> POSIX)
-> (ListIntegrationItem -> POSIX -> ListIntegrationItem)
-> Lens ListIntegrationItem ListIntegrationItem POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationItem' {POSIX
createdAt :: POSIX
$sel:createdAt:ListIntegrationItem' :: ListIntegrationItem -> POSIX
createdAt} -> POSIX
createdAt) (\s :: ListIntegrationItem
s@ListIntegrationItem' {} POSIX
a -> ListIntegrationItem
s {$sel:createdAt:ListIntegrationItem' :: POSIX
createdAt = POSIX
a} :: ListIntegrationItem) ((POSIX -> f POSIX)
 -> ListIntegrationItem -> f ListIntegrationItem)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListIntegrationItem
-> f ListIntegrationItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The timestamp of when the domain was most recently edited.
listIntegrationItem_lastUpdatedAt :: Lens.Lens' ListIntegrationItem Prelude.UTCTime
listIntegrationItem_lastUpdatedAt :: (UTCTime -> f UTCTime)
-> ListIntegrationItem -> f ListIntegrationItem
listIntegrationItem_lastUpdatedAt = (ListIntegrationItem -> POSIX)
-> (ListIntegrationItem -> POSIX -> ListIntegrationItem)
-> Lens ListIntegrationItem ListIntegrationItem POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListIntegrationItem' {POSIX
lastUpdatedAt :: POSIX
$sel:lastUpdatedAt:ListIntegrationItem' :: ListIntegrationItem -> POSIX
lastUpdatedAt} -> POSIX
lastUpdatedAt) (\s :: ListIntegrationItem
s@ListIntegrationItem' {} POSIX
a -> ListIntegrationItem
s {$sel:lastUpdatedAt:ListIntegrationItem' :: POSIX
lastUpdatedAt = POSIX
a} :: ListIntegrationItem) ((POSIX -> f POSIX)
 -> ListIntegrationItem -> f ListIntegrationItem)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ListIntegrationItem
-> f ListIntegrationItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Core.FromJSON ListIntegrationItem where
  parseJSON :: Value -> Parser ListIntegrationItem
parseJSON =
    String
-> (Object -> Parser ListIntegrationItem)
-> Value
-> Parser ListIntegrationItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ListIntegrationItem"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Text -> Text -> Text -> POSIX -> POSIX -> ListIntegrationItem
ListIntegrationItem'
            (Maybe (HashMap Text Text)
 -> Text -> Text -> Text -> POSIX -> POSIX -> ListIntegrationItem)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text -> Text -> Text -> POSIX -> POSIX -> ListIntegrationItem)
forall (f :: * -> *) a b. Functor 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 -> Text -> POSIX -> POSIX -> ListIntegrationItem)
-> Parser Text
-> Parser (Text -> Text -> POSIX -> POSIX -> ListIntegrationItem)
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
"DomainName")
            Parser (Text -> Text -> POSIX -> POSIX -> ListIntegrationItem)
-> Parser Text
-> Parser (Text -> POSIX -> POSIX -> ListIntegrationItem)
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
"Uri")
            Parser (Text -> POSIX -> POSIX -> ListIntegrationItem)
-> Parser Text -> Parser (POSIX -> POSIX -> ListIntegrationItem)
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 (POSIX -> POSIX -> ListIntegrationItem)
-> Parser POSIX -> Parser (POSIX -> ListIntegrationItem)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreatedAt")
            Parser (POSIX -> ListIntegrationItem)
-> Parser POSIX -> Parser ListIntegrationItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"LastUpdatedAt")
      )

instance Prelude.Hashable ListIntegrationItem

instance Prelude.NFData ListIntegrationItem