{-# 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.QuerySuggestionsBlockListSummary
-- 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.QuerySuggestionsBlockListSummary 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.QuerySuggestionsBlockListStatus
import qualified Amazonka.Prelude as Prelude

-- | Summary information on a query suggestions block list.
--
-- This includes information on the block list ID, block list name, when
-- the block list was created, when the block list was last updated, and
-- the count of block words\/phrases in the block list.
--
-- For information on the current quota limits for block lists, see
-- <https://docs.aws.amazon.com/kendra/latest/dg/quotas.html Quotas for Amazon Kendra>.
--
-- /See:/ 'newQuerySuggestionsBlockListSummary' smart constructor.
data QuerySuggestionsBlockListSummary = QuerySuggestionsBlockListSummary'
  { -- | The date-time summary information for a query suggestions block list was
    -- last created.
    QuerySuggestionsBlockListSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
    -- | The identifier of a block list.
    QuerySuggestionsBlockListSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The number of items in the block list file.
    QuerySuggestionsBlockListSummary -> Maybe Int
itemCount :: Prelude.Maybe Prelude.Int,
    -- | The name of the block list.
    QuerySuggestionsBlockListSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The status of the block list.
    QuerySuggestionsBlockListSummary
-> Maybe QuerySuggestionsBlockListStatus
status :: Prelude.Maybe QuerySuggestionsBlockListStatus,
    -- | The date-time the block list was last updated.
    QuerySuggestionsBlockListSummary -> Maybe POSIX
updatedAt :: Prelude.Maybe Data.POSIX
  }
  deriving (QuerySuggestionsBlockListSummary
-> QuerySuggestionsBlockListSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QuerySuggestionsBlockListSummary
-> QuerySuggestionsBlockListSummary -> Bool
$c/= :: QuerySuggestionsBlockListSummary
-> QuerySuggestionsBlockListSummary -> Bool
== :: QuerySuggestionsBlockListSummary
-> QuerySuggestionsBlockListSummary -> Bool
$c== :: QuerySuggestionsBlockListSummary
-> QuerySuggestionsBlockListSummary -> Bool
Prelude.Eq, ReadPrec [QuerySuggestionsBlockListSummary]
ReadPrec QuerySuggestionsBlockListSummary
Int -> ReadS QuerySuggestionsBlockListSummary
ReadS [QuerySuggestionsBlockListSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QuerySuggestionsBlockListSummary]
$creadListPrec :: ReadPrec [QuerySuggestionsBlockListSummary]
readPrec :: ReadPrec QuerySuggestionsBlockListSummary
$creadPrec :: ReadPrec QuerySuggestionsBlockListSummary
readList :: ReadS [QuerySuggestionsBlockListSummary]
$creadList :: ReadS [QuerySuggestionsBlockListSummary]
readsPrec :: Int -> ReadS QuerySuggestionsBlockListSummary
$creadsPrec :: Int -> ReadS QuerySuggestionsBlockListSummary
Prelude.Read, Int -> QuerySuggestionsBlockListSummary -> ShowS
[QuerySuggestionsBlockListSummary] -> ShowS
QuerySuggestionsBlockListSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QuerySuggestionsBlockListSummary] -> ShowS
$cshowList :: [QuerySuggestionsBlockListSummary] -> ShowS
show :: QuerySuggestionsBlockListSummary -> String
$cshow :: QuerySuggestionsBlockListSummary -> String
showsPrec :: Int -> QuerySuggestionsBlockListSummary -> ShowS
$cshowsPrec :: Int -> QuerySuggestionsBlockListSummary -> ShowS
Prelude.Show, forall x.
Rep QuerySuggestionsBlockListSummary x
-> QuerySuggestionsBlockListSummary
forall x.
QuerySuggestionsBlockListSummary
-> Rep QuerySuggestionsBlockListSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep QuerySuggestionsBlockListSummary x
-> QuerySuggestionsBlockListSummary
$cfrom :: forall x.
QuerySuggestionsBlockListSummary
-> Rep QuerySuggestionsBlockListSummary x
Prelude.Generic)

-- |
-- Create a value of 'QuerySuggestionsBlockListSummary' 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', 'querySuggestionsBlockListSummary_createdAt' - The date-time summary information for a query suggestions block list was
-- last created.
--
-- 'id', 'querySuggestionsBlockListSummary_id' - The identifier of a block list.
--
-- 'itemCount', 'querySuggestionsBlockListSummary_itemCount' - The number of items in the block list file.
--
-- 'name', 'querySuggestionsBlockListSummary_name' - The name of the block list.
--
-- 'status', 'querySuggestionsBlockListSummary_status' - The status of the block list.
--
-- 'updatedAt', 'querySuggestionsBlockListSummary_updatedAt' - The date-time the block list was last updated.
newQuerySuggestionsBlockListSummary ::
  QuerySuggestionsBlockListSummary
newQuerySuggestionsBlockListSummary :: QuerySuggestionsBlockListSummary
newQuerySuggestionsBlockListSummary =
  QuerySuggestionsBlockListSummary'
    { $sel:createdAt:QuerySuggestionsBlockListSummary' :: Maybe POSIX
createdAt =
        forall a. Maybe a
Prelude.Nothing,
      $sel:id:QuerySuggestionsBlockListSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:itemCount:QuerySuggestionsBlockListSummary' :: Maybe Int
itemCount = forall a. Maybe a
Prelude.Nothing,
      $sel:name:QuerySuggestionsBlockListSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:QuerySuggestionsBlockListSummary' :: Maybe QuerySuggestionsBlockListStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:updatedAt:QuerySuggestionsBlockListSummary' :: Maybe POSIX
updatedAt = forall a. Maybe a
Prelude.Nothing
    }

-- | The date-time summary information for a query suggestions block list was
-- last created.
querySuggestionsBlockListSummary_createdAt :: Lens.Lens' QuerySuggestionsBlockListSummary (Prelude.Maybe Prelude.UTCTime)
querySuggestionsBlockListSummary_createdAt :: Lens' QuerySuggestionsBlockListSummary (Maybe UTCTime)
querySuggestionsBlockListSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySuggestionsBlockListSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: QuerySuggestionsBlockListSummary
s@QuerySuggestionsBlockListSummary' {} Maybe POSIX
a -> QuerySuggestionsBlockListSummary
s {$sel:createdAt:QuerySuggestionsBlockListSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: QuerySuggestionsBlockListSummary) 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 a block list.
querySuggestionsBlockListSummary_id :: Lens.Lens' QuerySuggestionsBlockListSummary (Prelude.Maybe Prelude.Text)
querySuggestionsBlockListSummary_id :: Lens' QuerySuggestionsBlockListSummary (Maybe Text)
querySuggestionsBlockListSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySuggestionsBlockListSummary' {Maybe Text
id :: Maybe Text
$sel:id:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: QuerySuggestionsBlockListSummary
s@QuerySuggestionsBlockListSummary' {} Maybe Text
a -> QuerySuggestionsBlockListSummary
s {$sel:id:QuerySuggestionsBlockListSummary' :: Maybe Text
id = Maybe Text
a} :: QuerySuggestionsBlockListSummary)

-- | The number of items in the block list file.
querySuggestionsBlockListSummary_itemCount :: Lens.Lens' QuerySuggestionsBlockListSummary (Prelude.Maybe Prelude.Int)
querySuggestionsBlockListSummary_itemCount :: Lens' QuerySuggestionsBlockListSummary (Maybe Int)
querySuggestionsBlockListSummary_itemCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySuggestionsBlockListSummary' {Maybe Int
itemCount :: Maybe Int
$sel:itemCount:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe Int
itemCount} -> Maybe Int
itemCount) (\s :: QuerySuggestionsBlockListSummary
s@QuerySuggestionsBlockListSummary' {} Maybe Int
a -> QuerySuggestionsBlockListSummary
s {$sel:itemCount:QuerySuggestionsBlockListSummary' :: Maybe Int
itemCount = Maybe Int
a} :: QuerySuggestionsBlockListSummary)

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

-- | The status of the block list.
querySuggestionsBlockListSummary_status :: Lens.Lens' QuerySuggestionsBlockListSummary (Prelude.Maybe QuerySuggestionsBlockListStatus)
querySuggestionsBlockListSummary_status :: Lens'
  QuerySuggestionsBlockListSummary
  (Maybe QuerySuggestionsBlockListStatus)
querySuggestionsBlockListSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySuggestionsBlockListSummary' {Maybe QuerySuggestionsBlockListStatus
status :: Maybe QuerySuggestionsBlockListStatus
$sel:status:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary
-> Maybe QuerySuggestionsBlockListStatus
status} -> Maybe QuerySuggestionsBlockListStatus
status) (\s :: QuerySuggestionsBlockListSummary
s@QuerySuggestionsBlockListSummary' {} Maybe QuerySuggestionsBlockListStatus
a -> QuerySuggestionsBlockListSummary
s {$sel:status:QuerySuggestionsBlockListSummary' :: Maybe QuerySuggestionsBlockListStatus
status = Maybe QuerySuggestionsBlockListStatus
a} :: QuerySuggestionsBlockListSummary)

-- | The date-time the block list was last updated.
querySuggestionsBlockListSummary_updatedAt :: Lens.Lens' QuerySuggestionsBlockListSummary (Prelude.Maybe Prelude.UTCTime)
querySuggestionsBlockListSummary_updatedAt :: Lens' QuerySuggestionsBlockListSummary (Maybe UTCTime)
querySuggestionsBlockListSummary_updatedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySuggestionsBlockListSummary' {Maybe POSIX
updatedAt :: Maybe POSIX
$sel:updatedAt:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe POSIX
updatedAt} -> Maybe POSIX
updatedAt) (\s :: QuerySuggestionsBlockListSummary
s@QuerySuggestionsBlockListSummary' {} Maybe POSIX
a -> QuerySuggestionsBlockListSummary
s {$sel:updatedAt:QuerySuggestionsBlockListSummary' :: Maybe POSIX
updatedAt = Maybe POSIX
a} :: QuerySuggestionsBlockListSummary) 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
    QuerySuggestionsBlockListSummary
  where
  parseJSON :: Value -> Parser QuerySuggestionsBlockListSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"QuerySuggestionsBlockListSummary"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe QuerySuggestionsBlockListStatus
-> Maybe POSIX
-> QuerySuggestionsBlockListSummary
QuerySuggestionsBlockListSummary'
            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
"ItemCount")
            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
    QuerySuggestionsBlockListSummary
  where
  hashWithSalt :: Int -> QuerySuggestionsBlockListSummary -> Int
hashWithSalt
    Int
_salt
    QuerySuggestionsBlockListSummary' {Maybe Int
Maybe Text
Maybe POSIX
Maybe QuerySuggestionsBlockListStatus
updatedAt :: Maybe POSIX
status :: Maybe QuerySuggestionsBlockListStatus
name :: Maybe Text
itemCount :: Maybe Int
id :: Maybe Text
createdAt :: Maybe POSIX
$sel:updatedAt:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe POSIX
$sel:status:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary
-> Maybe QuerySuggestionsBlockListStatus
$sel:name:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe Text
$sel:itemCount:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe Int
$sel:id:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> Maybe Text
$sel:createdAt:QuerySuggestionsBlockListSummary' :: QuerySuggestionsBlockListSummary -> 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 Int
itemCount
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QuerySuggestionsBlockListStatus
status
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
updatedAt

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