{-# 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 #-}
module Amazonka.Kendra.Types.FacetResult where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import {-# SOURCE #-} Amazonka.Kendra.Types.DocumentAttributeValueCountPair
import Amazonka.Kendra.Types.DocumentAttributeValueType
import qualified Amazonka.Prelude as Prelude
data FacetResult = FacetResult'
{
FacetResult -> Maybe Text
documentAttributeKey :: Prelude.Maybe Prelude.Text,
FacetResult -> Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs :: Prelude.Maybe [DocumentAttributeValueCountPair],
FacetResult -> Maybe DocumentAttributeValueType
documentAttributeValueType :: Prelude.Maybe DocumentAttributeValueType
}
deriving (FacetResult -> FacetResult -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FacetResult -> FacetResult -> Bool
$c/= :: FacetResult -> FacetResult -> Bool
== :: FacetResult -> FacetResult -> Bool
$c== :: FacetResult -> FacetResult -> Bool
Prelude.Eq, ReadPrec [FacetResult]
ReadPrec FacetResult
Int -> ReadS FacetResult
ReadS [FacetResult]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FacetResult]
$creadListPrec :: ReadPrec [FacetResult]
readPrec :: ReadPrec FacetResult
$creadPrec :: ReadPrec FacetResult
readList :: ReadS [FacetResult]
$creadList :: ReadS [FacetResult]
readsPrec :: Int -> ReadS FacetResult
$creadsPrec :: Int -> ReadS FacetResult
Prelude.Read, Int -> FacetResult -> ShowS
[FacetResult] -> ShowS
FacetResult -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FacetResult] -> ShowS
$cshowList :: [FacetResult] -> ShowS
show :: FacetResult -> String
$cshow :: FacetResult -> String
showsPrec :: Int -> FacetResult -> ShowS
$cshowsPrec :: Int -> FacetResult -> ShowS
Prelude.Show, forall x. Rep FacetResult x -> FacetResult
forall x. FacetResult -> Rep FacetResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FacetResult x -> FacetResult
$cfrom :: forall x. FacetResult -> Rep FacetResult x
Prelude.Generic)
newFacetResult ::
FacetResult
newFacetResult :: FacetResult
newFacetResult =
FacetResult'
{ $sel:documentAttributeKey:FacetResult' :: Maybe Text
documentAttributeKey =
forall a. Maybe a
Prelude.Nothing,
$sel:documentAttributeValueCountPairs:FacetResult' :: Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs = forall a. Maybe a
Prelude.Nothing,
$sel:documentAttributeValueType:FacetResult' :: Maybe DocumentAttributeValueType
documentAttributeValueType = forall a. Maybe a
Prelude.Nothing
}
facetResult_documentAttributeKey :: Lens.Lens' FacetResult (Prelude.Maybe Prelude.Text)
facetResult_documentAttributeKey :: Lens' FacetResult (Maybe Text)
facetResult_documentAttributeKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FacetResult' {Maybe Text
documentAttributeKey :: Maybe Text
$sel:documentAttributeKey:FacetResult' :: FacetResult -> Maybe Text
documentAttributeKey} -> Maybe Text
documentAttributeKey) (\s :: FacetResult
s@FacetResult' {} Maybe Text
a -> FacetResult
s {$sel:documentAttributeKey:FacetResult' :: Maybe Text
documentAttributeKey = Maybe Text
a} :: FacetResult)
facetResult_documentAttributeValueCountPairs :: Lens.Lens' FacetResult (Prelude.Maybe [DocumentAttributeValueCountPair])
facetResult_documentAttributeValueCountPairs :: Lens' FacetResult (Maybe [DocumentAttributeValueCountPair])
facetResult_documentAttributeValueCountPairs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FacetResult' {Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs :: Maybe [DocumentAttributeValueCountPair]
$sel:documentAttributeValueCountPairs:FacetResult' :: FacetResult -> Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs} -> Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs) (\s :: FacetResult
s@FacetResult' {} Maybe [DocumentAttributeValueCountPair]
a -> FacetResult
s {$sel:documentAttributeValueCountPairs:FacetResult' :: Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs = Maybe [DocumentAttributeValueCountPair]
a} :: FacetResult) 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
facetResult_documentAttributeValueType :: Lens.Lens' FacetResult (Prelude.Maybe DocumentAttributeValueType)
facetResult_documentAttributeValueType :: Lens' FacetResult (Maybe DocumentAttributeValueType)
facetResult_documentAttributeValueType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FacetResult' {Maybe DocumentAttributeValueType
documentAttributeValueType :: Maybe DocumentAttributeValueType
$sel:documentAttributeValueType:FacetResult' :: FacetResult -> Maybe DocumentAttributeValueType
documentAttributeValueType} -> Maybe DocumentAttributeValueType
documentAttributeValueType) (\s :: FacetResult
s@FacetResult' {} Maybe DocumentAttributeValueType
a -> FacetResult
s {$sel:documentAttributeValueType:FacetResult' :: Maybe DocumentAttributeValueType
documentAttributeValueType = Maybe DocumentAttributeValueType
a} :: FacetResult)
instance Data.FromJSON FacetResult where
parseJSON :: Value -> Parser FacetResult
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FacetResult"
( \Object
x ->
Maybe Text
-> Maybe [DocumentAttributeValueCountPair]
-> Maybe DocumentAttributeValueType
-> FacetResult
FacetResult'
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
"DocumentAttributeKey")
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
"DocumentAttributeValueCountPairs"
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 (Maybe a)
Data..:? Key
"DocumentAttributeValueType")
)
instance Prelude.Hashable FacetResult where
hashWithSalt :: Int -> FacetResult -> Int
hashWithSalt Int
_salt FacetResult' {Maybe [DocumentAttributeValueCountPair]
Maybe Text
Maybe DocumentAttributeValueType
documentAttributeValueType :: Maybe DocumentAttributeValueType
documentAttributeValueCountPairs :: Maybe [DocumentAttributeValueCountPair]
documentAttributeKey :: Maybe Text
$sel:documentAttributeValueType:FacetResult' :: FacetResult -> Maybe DocumentAttributeValueType
$sel:documentAttributeValueCountPairs:FacetResult' :: FacetResult -> Maybe [DocumentAttributeValueCountPair]
$sel:documentAttributeKey:FacetResult' :: FacetResult -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentAttributeKey
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DocumentAttributeValueType
documentAttributeValueType
instance Prelude.NFData FacetResult where
rnf :: FacetResult -> ()
rnf FacetResult' {Maybe [DocumentAttributeValueCountPair]
Maybe Text
Maybe DocumentAttributeValueType
documentAttributeValueType :: Maybe DocumentAttributeValueType
documentAttributeValueCountPairs :: Maybe [DocumentAttributeValueCountPair]
documentAttributeKey :: Maybe Text
$sel:documentAttributeValueType:FacetResult' :: FacetResult -> Maybe DocumentAttributeValueType
$sel:documentAttributeValueCountPairs:FacetResult' :: FacetResult -> Maybe [DocumentAttributeValueCountPair]
$sel:documentAttributeKey:FacetResult' :: FacetResult -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentAttributeKey
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DocumentAttributeValueCountPair]
documentAttributeValueCountPairs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DocumentAttributeValueType
documentAttributeValueType