{-# 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.Kendra.Types.ThesaurusSummary
-- 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.Kendra.Types.ThesaurusSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kendra.Types.ThesaurusStatus
import qualified Amazonka.Prelude as Prelude

-- | An array of summary information for a thesaurus or multiple thesauri.
--
-- /See:/ 'newThesaurusSummary' smart constructor.
data ThesaurusSummary = ThesaurusSummary'
  { -- | The Unix datetime that the thesaurus was created.
    ThesaurusSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The identifier of the thesaurus.
    ThesaurusSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the thesaurus.
    ThesaurusSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The status of the thesaurus.
    ThesaurusSummary -> Maybe ThesaurusStatus
status :: Prelude.Maybe ThesaurusStatus,
    -- | The Unix datetime that the thesaurus was last updated.
    ThesaurusSummary -> Maybe POSIX
updatedAt :: Prelude.Maybe Data.POSIX
  }
  deriving (ThesaurusSummary -> ThesaurusSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ThesaurusSummary -> ThesaurusSummary -> Bool
$c/= :: ThesaurusSummary -> ThesaurusSummary -> Bool
== :: ThesaurusSummary -> ThesaurusSummary -> Bool
$c== :: ThesaurusSummary -> ThesaurusSummary -> Bool
Prelude.Eq, ReadPrec [ThesaurusSummary]
ReadPrec ThesaurusSummary
Int -> ReadS ThesaurusSummary
ReadS [ThesaurusSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ThesaurusSummary]
$creadListPrec :: ReadPrec [ThesaurusSummary]
readPrec :: ReadPrec ThesaurusSummary
$creadPrec :: ReadPrec ThesaurusSummary
readList :: ReadS [ThesaurusSummary]
$creadList :: ReadS [ThesaurusSummary]
readsPrec :: Int -> ReadS ThesaurusSummary
$creadsPrec :: Int -> ReadS ThesaurusSummary
Prelude.Read, Int -> ThesaurusSummary -> ShowS
[ThesaurusSummary] -> ShowS
ThesaurusSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ThesaurusSummary] -> ShowS
$cshowList :: [ThesaurusSummary] -> ShowS
show :: ThesaurusSummary -> String
$cshow :: ThesaurusSummary -> String
showsPrec :: Int -> ThesaurusSummary -> ShowS
$cshowsPrec :: Int -> ThesaurusSummary -> ShowS
Prelude.Show, forall x. Rep ThesaurusSummary x -> ThesaurusSummary
forall x. ThesaurusSummary -> Rep ThesaurusSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ThesaurusSummary x -> ThesaurusSummary
$cfrom :: forall x. ThesaurusSummary -> Rep ThesaurusSummary x
Prelude.Generic)

-- |
-- Create a value of 'ThesaurusSummary' 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', 'thesaurusSummary_createdAt' - The Unix datetime that the thesaurus was created.
--
-- 'id', 'thesaurusSummary_id' - The identifier of the thesaurus.
--
-- 'name', 'thesaurusSummary_name' - The name of the thesaurus.
--
-- 'status', 'thesaurusSummary_status' - The status of the thesaurus.
--
-- 'updatedAt', 'thesaurusSummary_updatedAt' - The Unix datetime that the thesaurus was last updated.
newThesaurusSummary ::
  ThesaurusSummary
newThesaurusSummary :: ThesaurusSummary
newThesaurusSummary =
  ThesaurusSummary'
    { $sel:createdAt:ThesaurusSummary' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ThesaurusSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ThesaurusSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ThesaurusSummary' :: Maybe ThesaurusStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:ThesaurusSummary' :: Maybe POSIX
updatedAt = forall a. Maybe a
Prelude.Nothing
    }

-- | The Unix datetime that the thesaurus was created.
thesaurusSummary_createdAt :: Lens.Lens' ThesaurusSummary (Prelude.Maybe Prelude.UTCTime)
thesaurusSummary_createdAt :: Lens' ThesaurusSummary (Maybe UTCTime)
thesaurusSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThesaurusSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ThesaurusSummary' :: ThesaurusSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ThesaurusSummary
s@ThesaurusSummary' {} Maybe POSIX
a -> ThesaurusSummary
s {$sel:createdAt:ThesaurusSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ThesaurusSummary) 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 identifier of the thesaurus.
thesaurusSummary_id :: Lens.Lens' ThesaurusSummary (Prelude.Maybe Prelude.Text)
thesaurusSummary_id :: Lens' ThesaurusSummary (Maybe Text)
thesaurusSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThesaurusSummary' {Maybe Text
id :: Maybe Text
$sel:id:ThesaurusSummary' :: ThesaurusSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ThesaurusSummary
s@ThesaurusSummary' {} Maybe Text
a -> ThesaurusSummary
s {$sel:id:ThesaurusSummary' :: Maybe Text
id = Maybe Text
a} :: ThesaurusSummary)

-- | The name of the thesaurus.
thesaurusSummary_name :: Lens.Lens' ThesaurusSummary (Prelude.Maybe Prelude.Text)
thesaurusSummary_name :: Lens' ThesaurusSummary (Maybe Text)
thesaurusSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThesaurusSummary' {Maybe Text
name :: Maybe Text
$sel:name:ThesaurusSummary' :: ThesaurusSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ThesaurusSummary
s@ThesaurusSummary' {} Maybe Text
a -> ThesaurusSummary
s {$sel:name:ThesaurusSummary' :: Maybe Text
name = Maybe Text
a} :: ThesaurusSummary)

-- | The status of the thesaurus.
thesaurusSummary_status :: Lens.Lens' ThesaurusSummary (Prelude.Maybe ThesaurusStatus)
thesaurusSummary_status :: Lens' ThesaurusSummary (Maybe ThesaurusStatus)
thesaurusSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThesaurusSummary' {Maybe ThesaurusStatus
status :: Maybe ThesaurusStatus
$sel:status:ThesaurusSummary' :: ThesaurusSummary -> Maybe ThesaurusStatus
status} -> Maybe ThesaurusStatus
status) (\s :: ThesaurusSummary
s@ThesaurusSummary' {} Maybe ThesaurusStatus
a -> ThesaurusSummary
s {$sel:status:ThesaurusSummary' :: Maybe ThesaurusStatus
status = Maybe ThesaurusStatus
a} :: ThesaurusSummary)

-- | The Unix datetime that the thesaurus was last updated.
thesaurusSummary_updatedAt :: Lens.Lens' ThesaurusSummary (Prelude.Maybe Prelude.UTCTime)
thesaurusSummary_updatedAt :: Lens' ThesaurusSummary (Maybe UTCTime)
thesaurusSummary_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ThesaurusSummary' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:ThesaurusSummary' :: ThesaurusSummary -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: ThesaurusSummary
s@ThesaurusSummary' {} Maybe POSIX
a -> ThesaurusSummary
s {$sel:updatedAt:ThesaurusSummary' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: ThesaurusSummary) 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

instance Data.FromJSON ThesaurusSummary where
  parseJSON :: Value -> Parser ThesaurusSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ThesaurusSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe ThesaurusStatus
-> Maybe POSIX
-> ThesaurusSummary
ThesaurusSummary'
            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
"Id")
            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
"Name")
            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
"Status")
            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
"UpdatedAt")
      )

instance Prelude.Hashable ThesaurusSummary where
  hashWithSalt :: Int -> ThesaurusSummary -> Int
hashWithSalt Int
_salt ThesaurusSummary' {Maybe Text
Maybe POSIX
Maybe ThesaurusStatus
updatedAt :: Maybe POSIX
status :: Maybe ThesaurusStatus
name :: Maybe Text
id :: Maybe Text
createdAt :: Maybe POSIX
$sel:updatedAt:ThesaurusSummary' :: ThesaurusSummary -> Maybe POSIX
$sel:status:ThesaurusSummary' :: ThesaurusSummary -> Maybe ThesaurusStatus
$sel:name:ThesaurusSummary' :: ThesaurusSummary -> Maybe Text
$sel:id:ThesaurusSummary' :: ThesaurusSummary -> Maybe Text
$sel:createdAt:ThesaurusSummary' :: ThesaurusSummary -> 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 Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ThesaurusStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
updatedAt

instance Prelude.NFData ThesaurusSummary where
  rnf :: ThesaurusSummary -> ()
rnf ThesaurusSummary' {Maybe Text
Maybe POSIX
Maybe ThesaurusStatus
updatedAt :: Maybe POSIX
status :: Maybe ThesaurusStatus
name :: Maybe Text
id :: Maybe Text
createdAt :: Maybe POSIX
$sel:updatedAt:ThesaurusSummary' :: ThesaurusSummary -> Maybe POSIX
$sel:status:ThesaurusSummary' :: ThesaurusSummary -> Maybe ThesaurusStatus
$sel:name:ThesaurusSummary' :: ThesaurusSummary -> Maybe Text
$sel:id:ThesaurusSummary' :: ThesaurusSummary -> Maybe Text
$sel:createdAt:ThesaurusSummary' :: ThesaurusSummary -> 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 Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ThesaurusStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
updatedAt