{-# 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.QuickSight.Types.FolderSummary
-- 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.QuickSight.Types.FolderSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.QuickSight.Types.FolderType

-- | A summary of the folder.
--
-- /See:/ 'newFolderSummary' smart constructor.
data FolderSummary = FolderSummary'
  { -- | The time that the folder was last updated.
    FolderSummary -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN).
    FolderSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The time that the folder was created.
    FolderSummary -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The folder ID.
    FolderSummary -> Maybe Text
folderId :: Prelude.Maybe Prelude.Text,
    -- | The display name of the folder.
    FolderSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of folder.
    FolderSummary -> Maybe FolderType
folderType :: Prelude.Maybe FolderType
  }
  deriving (FolderSummary -> FolderSummary -> Bool
(FolderSummary -> FolderSummary -> Bool)
-> (FolderSummary -> FolderSummary -> Bool) -> Eq FolderSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FolderSummary -> FolderSummary -> Bool
$c/= :: FolderSummary -> FolderSummary -> Bool
== :: FolderSummary -> FolderSummary -> Bool
$c== :: FolderSummary -> FolderSummary -> Bool
Prelude.Eq, ReadPrec [FolderSummary]
ReadPrec FolderSummary
Int -> ReadS FolderSummary
ReadS [FolderSummary]
(Int -> ReadS FolderSummary)
-> ReadS [FolderSummary]
-> ReadPrec FolderSummary
-> ReadPrec [FolderSummary]
-> Read FolderSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FolderSummary]
$creadListPrec :: ReadPrec [FolderSummary]
readPrec :: ReadPrec FolderSummary
$creadPrec :: ReadPrec FolderSummary
readList :: ReadS [FolderSummary]
$creadList :: ReadS [FolderSummary]
readsPrec :: Int -> ReadS FolderSummary
$creadsPrec :: Int -> ReadS FolderSummary
Prelude.Read, Int -> FolderSummary -> ShowS
[FolderSummary] -> ShowS
FolderSummary -> String
(Int -> FolderSummary -> ShowS)
-> (FolderSummary -> String)
-> ([FolderSummary] -> ShowS)
-> Show FolderSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FolderSummary] -> ShowS
$cshowList :: [FolderSummary] -> ShowS
show :: FolderSummary -> String
$cshow :: FolderSummary -> String
showsPrec :: Int -> FolderSummary -> ShowS
$cshowsPrec :: Int -> FolderSummary -> ShowS
Prelude.Show, (forall x. FolderSummary -> Rep FolderSummary x)
-> (forall x. Rep FolderSummary x -> FolderSummary)
-> Generic FolderSummary
forall x. Rep FolderSummary x -> FolderSummary
forall x. FolderSummary -> Rep FolderSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FolderSummary x -> FolderSummary
$cfrom :: forall x. FolderSummary -> Rep FolderSummary x
Prelude.Generic)

-- |
-- Create a value of 'FolderSummary' 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:
--
-- 'lastUpdatedTime', 'folderSummary_lastUpdatedTime' - The time that the folder was last updated.
--
-- 'arn', 'folderSummary_arn' - The Amazon Resource Name (ARN).
--
-- 'createdTime', 'folderSummary_createdTime' - The time that the folder was created.
--
-- 'folderId', 'folderSummary_folderId' - The folder ID.
--
-- 'name', 'folderSummary_name' - The display name of the folder.
--
-- 'folderType', 'folderSummary_folderType' - The type of folder.
newFolderSummary ::
  FolderSummary
newFolderSummary :: FolderSummary
newFolderSummary =
  FolderSummary' :: Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe FolderType
-> FolderSummary
FolderSummary'
    { $sel:lastUpdatedTime:FolderSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:FolderSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:FolderSummary' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:folderId:FolderSummary' :: Maybe Text
folderId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:FolderSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:folderType:FolderSummary' :: Maybe FolderType
folderType = Maybe FolderType
forall a. Maybe a
Prelude.Nothing
    }

-- | The time that the folder was last updated.
folderSummary_lastUpdatedTime :: Lens.Lens' FolderSummary (Prelude.Maybe Prelude.UTCTime)
folderSummary_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FolderSummary -> f FolderSummary
folderSummary_lastUpdatedTime = (FolderSummary -> Maybe POSIX)
-> (FolderSummary -> Maybe POSIX -> FolderSummary)
-> Lens FolderSummary FolderSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FolderSummary' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:FolderSummary' :: FolderSummary -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: FolderSummary
s@FolderSummary' {} Maybe POSIX
a -> FolderSummary
s {$sel:lastUpdatedTime:FolderSummary' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: FolderSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> FolderSummary -> f FolderSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FolderSummary
-> f FolderSummary
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 Amazon Resource Name (ARN).
folderSummary_arn :: Lens.Lens' FolderSummary (Prelude.Maybe Prelude.Text)
folderSummary_arn :: (Maybe Text -> f (Maybe Text)) -> FolderSummary -> f FolderSummary
folderSummary_arn = (FolderSummary -> Maybe Text)
-> (FolderSummary -> Maybe Text -> FolderSummary)
-> Lens FolderSummary FolderSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FolderSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:FolderSummary' :: FolderSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: FolderSummary
s@FolderSummary' {} Maybe Text
a -> FolderSummary
s {$sel:arn:FolderSummary' :: Maybe Text
arn = Maybe Text
a} :: FolderSummary)

-- | The time that the folder was created.
folderSummary_createdTime :: Lens.Lens' FolderSummary (Prelude.Maybe Prelude.UTCTime)
folderSummary_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FolderSummary -> f FolderSummary
folderSummary_createdTime = (FolderSummary -> Maybe POSIX)
-> (FolderSummary -> Maybe POSIX -> FolderSummary)
-> Lens FolderSummary FolderSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FolderSummary' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:FolderSummary' :: FolderSummary -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: FolderSummary
s@FolderSummary' {} Maybe POSIX
a -> FolderSummary
s {$sel:createdTime:FolderSummary' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: FolderSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> FolderSummary -> f FolderSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FolderSummary
-> f FolderSummary
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 folder ID.
folderSummary_folderId :: Lens.Lens' FolderSummary (Prelude.Maybe Prelude.Text)
folderSummary_folderId :: (Maybe Text -> f (Maybe Text)) -> FolderSummary -> f FolderSummary
folderSummary_folderId = (FolderSummary -> Maybe Text)
-> (FolderSummary -> Maybe Text -> FolderSummary)
-> Lens FolderSummary FolderSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FolderSummary' {Maybe Text
folderId :: Maybe Text
$sel:folderId:FolderSummary' :: FolderSummary -> Maybe Text
folderId} -> Maybe Text
folderId) (\s :: FolderSummary
s@FolderSummary' {} Maybe Text
a -> FolderSummary
s {$sel:folderId:FolderSummary' :: Maybe Text
folderId = Maybe Text
a} :: FolderSummary)

-- | The display name of the folder.
folderSummary_name :: Lens.Lens' FolderSummary (Prelude.Maybe Prelude.Text)
folderSummary_name :: (Maybe Text -> f (Maybe Text)) -> FolderSummary -> f FolderSummary
folderSummary_name = (FolderSummary -> Maybe Text)
-> (FolderSummary -> Maybe Text -> FolderSummary)
-> Lens FolderSummary FolderSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FolderSummary' {Maybe Text
name :: Maybe Text
$sel:name:FolderSummary' :: FolderSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: FolderSummary
s@FolderSummary' {} Maybe Text
a -> FolderSummary
s {$sel:name:FolderSummary' :: Maybe Text
name = Maybe Text
a} :: FolderSummary)

-- | The type of folder.
folderSummary_folderType :: Lens.Lens' FolderSummary (Prelude.Maybe FolderType)
folderSummary_folderType :: (Maybe FolderType -> f (Maybe FolderType))
-> FolderSummary -> f FolderSummary
folderSummary_folderType = (FolderSummary -> Maybe FolderType)
-> (FolderSummary -> Maybe FolderType -> FolderSummary)
-> Lens
     FolderSummary FolderSummary (Maybe FolderType) (Maybe FolderType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FolderSummary' {Maybe FolderType
folderType :: Maybe FolderType
$sel:folderType:FolderSummary' :: FolderSummary -> Maybe FolderType
folderType} -> Maybe FolderType
folderType) (\s :: FolderSummary
s@FolderSummary' {} Maybe FolderType
a -> FolderSummary
s {$sel:folderType:FolderSummary' :: Maybe FolderType
folderType = Maybe FolderType
a} :: FolderSummary)

instance Core.FromJSON FolderSummary where
  parseJSON :: Value -> Parser FolderSummary
parseJSON =
    String
-> (Object -> Parser FolderSummary)
-> Value
-> Parser FolderSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FolderSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe FolderType
-> FolderSummary
FolderSummary'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe FolderType
 -> FolderSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe FolderType
      -> FolderSummary)
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
"LastUpdatedTime")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe FolderType
   -> FolderSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe Text -> Maybe FolderType -> FolderSummary)
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
"Arn")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe Text -> Maybe FolderType -> FolderSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe FolderType -> FolderSummary)
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
"CreatedTime")
            Parser
  (Maybe Text -> Maybe Text -> Maybe FolderType -> FolderSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe FolderType -> FolderSummary)
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
"FolderId")
            Parser (Maybe Text -> Maybe FolderType -> FolderSummary)
-> Parser (Maybe Text)
-> Parser (Maybe FolderType -> FolderSummary)
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
"Name")
            Parser (Maybe FolderType -> FolderSummary)
-> Parser (Maybe FolderType) -> Parser FolderSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe FolderType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FolderType")
      )

instance Prelude.Hashable FolderSummary

instance Prelude.NFData FolderSummary