{-# 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.DocumentAttributeValueCountPair 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.DocumentAttributeValue
import {-# SOURCE #-} Amazonka.Kendra.Types.FacetResult
import qualified Amazonka.Prelude as Prelude
data DocumentAttributeValueCountPair = DocumentAttributeValueCountPair'
{
DocumentAttributeValueCountPair -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
DocumentAttributeValueCountPair -> Maybe DocumentAttributeValue
documentAttributeValue :: Prelude.Maybe DocumentAttributeValue,
DocumentAttributeValueCountPair -> Maybe [FacetResult]
facetResults :: Prelude.Maybe [FacetResult]
}
deriving (DocumentAttributeValueCountPair
-> DocumentAttributeValueCountPair -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocumentAttributeValueCountPair
-> DocumentAttributeValueCountPair -> Bool
$c/= :: DocumentAttributeValueCountPair
-> DocumentAttributeValueCountPair -> Bool
== :: DocumentAttributeValueCountPair
-> DocumentAttributeValueCountPair -> Bool
$c== :: DocumentAttributeValueCountPair
-> DocumentAttributeValueCountPair -> Bool
Prelude.Eq, ReadPrec [DocumentAttributeValueCountPair]
ReadPrec DocumentAttributeValueCountPair
Int -> ReadS DocumentAttributeValueCountPair
ReadS [DocumentAttributeValueCountPair]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DocumentAttributeValueCountPair]
$creadListPrec :: ReadPrec [DocumentAttributeValueCountPair]
readPrec :: ReadPrec DocumentAttributeValueCountPair
$creadPrec :: ReadPrec DocumentAttributeValueCountPair
readList :: ReadS [DocumentAttributeValueCountPair]
$creadList :: ReadS [DocumentAttributeValueCountPair]
readsPrec :: Int -> ReadS DocumentAttributeValueCountPair
$creadsPrec :: Int -> ReadS DocumentAttributeValueCountPair
Prelude.Read, Int -> DocumentAttributeValueCountPair -> ShowS
[DocumentAttributeValueCountPair] -> ShowS
DocumentAttributeValueCountPair -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocumentAttributeValueCountPair] -> ShowS
$cshowList :: [DocumentAttributeValueCountPair] -> ShowS
show :: DocumentAttributeValueCountPair -> String
$cshow :: DocumentAttributeValueCountPair -> String
showsPrec :: Int -> DocumentAttributeValueCountPair -> ShowS
$cshowsPrec :: Int -> DocumentAttributeValueCountPair -> ShowS
Prelude.Show, forall x.
Rep DocumentAttributeValueCountPair x
-> DocumentAttributeValueCountPair
forall x.
DocumentAttributeValueCountPair
-> Rep DocumentAttributeValueCountPair x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DocumentAttributeValueCountPair x
-> DocumentAttributeValueCountPair
$cfrom :: forall x.
DocumentAttributeValueCountPair
-> Rep DocumentAttributeValueCountPair x
Prelude.Generic)
newDocumentAttributeValueCountPair ::
DocumentAttributeValueCountPair
newDocumentAttributeValueCountPair :: DocumentAttributeValueCountPair
newDocumentAttributeValueCountPair =
DocumentAttributeValueCountPair'
{ $sel:count:DocumentAttributeValueCountPair' :: Maybe Int
count =
forall a. Maybe a
Prelude.Nothing,
$sel:documentAttributeValue:DocumentAttributeValueCountPair' :: Maybe DocumentAttributeValue
documentAttributeValue = forall a. Maybe a
Prelude.Nothing,
$sel:facetResults:DocumentAttributeValueCountPair' :: Maybe [FacetResult]
facetResults = forall a. Maybe a
Prelude.Nothing
}
documentAttributeValueCountPair_count :: Lens.Lens' DocumentAttributeValueCountPair (Prelude.Maybe Prelude.Int)
documentAttributeValueCountPair_count :: Lens' DocumentAttributeValueCountPair (Maybe Int)
documentAttributeValueCountPair_count = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentAttributeValueCountPair' {Maybe Int
count :: Maybe Int
$sel:count:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe Int
count} -> Maybe Int
count) (\s :: DocumentAttributeValueCountPair
s@DocumentAttributeValueCountPair' {} Maybe Int
a -> DocumentAttributeValueCountPair
s {$sel:count:DocumentAttributeValueCountPair' :: Maybe Int
count = Maybe Int
a} :: DocumentAttributeValueCountPair)
documentAttributeValueCountPair_documentAttributeValue :: Lens.Lens' DocumentAttributeValueCountPair (Prelude.Maybe DocumentAttributeValue)
documentAttributeValueCountPair_documentAttributeValue :: Lens'
DocumentAttributeValueCountPair (Maybe DocumentAttributeValue)
documentAttributeValueCountPair_documentAttributeValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentAttributeValueCountPair' {Maybe DocumentAttributeValue
documentAttributeValue :: Maybe DocumentAttributeValue
$sel:documentAttributeValue:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe DocumentAttributeValue
documentAttributeValue} -> Maybe DocumentAttributeValue
documentAttributeValue) (\s :: DocumentAttributeValueCountPair
s@DocumentAttributeValueCountPair' {} Maybe DocumentAttributeValue
a -> DocumentAttributeValueCountPair
s {$sel:documentAttributeValue:DocumentAttributeValueCountPair' :: Maybe DocumentAttributeValue
documentAttributeValue = Maybe DocumentAttributeValue
a} :: DocumentAttributeValueCountPair)
documentAttributeValueCountPair_facetResults :: Lens.Lens' DocumentAttributeValueCountPair (Prelude.Maybe [FacetResult])
documentAttributeValueCountPair_facetResults :: Lens' DocumentAttributeValueCountPair (Maybe [FacetResult])
documentAttributeValueCountPair_facetResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocumentAttributeValueCountPair' {Maybe [FacetResult]
facetResults :: Maybe [FacetResult]
$sel:facetResults:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe [FacetResult]
facetResults} -> Maybe [FacetResult]
facetResults) (\s :: DocumentAttributeValueCountPair
s@DocumentAttributeValueCountPair' {} Maybe [FacetResult]
a -> DocumentAttributeValueCountPair
s {$sel:facetResults:DocumentAttributeValueCountPair' :: Maybe [FacetResult]
facetResults = Maybe [FacetResult]
a} :: DocumentAttributeValueCountPair) 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
instance
Data.FromJSON
DocumentAttributeValueCountPair
where
parseJSON :: Value -> Parser DocumentAttributeValueCountPair
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DocumentAttributeValueCountPair"
( \Object
x ->
Maybe Int
-> Maybe DocumentAttributeValue
-> Maybe [FacetResult]
-> DocumentAttributeValueCountPair
DocumentAttributeValueCountPair'
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
"Count")
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
"DocumentAttributeValue")
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
"FacetResults" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
DocumentAttributeValueCountPair
where
hashWithSalt :: Int -> DocumentAttributeValueCountPair -> Int
hashWithSalt
Int
_salt
DocumentAttributeValueCountPair' {Maybe Int
Maybe [FacetResult]
Maybe DocumentAttributeValue
facetResults :: Maybe [FacetResult]
documentAttributeValue :: Maybe DocumentAttributeValue
count :: Maybe Int
$sel:facetResults:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe [FacetResult]
$sel:documentAttributeValue:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe DocumentAttributeValue
$sel:count:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
count
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DocumentAttributeValue
documentAttributeValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [FacetResult]
facetResults
instance
Prelude.NFData
DocumentAttributeValueCountPair
where
rnf :: DocumentAttributeValueCountPair -> ()
rnf DocumentAttributeValueCountPair' {Maybe Int
Maybe [FacetResult]
Maybe DocumentAttributeValue
facetResults :: Maybe [FacetResult]
documentAttributeValue :: Maybe DocumentAttributeValue
count :: Maybe Int
$sel:facetResults:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe [FacetResult]
$sel:documentAttributeValue:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe DocumentAttributeValue
$sel:count:DocumentAttributeValueCountPair' :: DocumentAttributeValueCountPair -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
count
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DocumentAttributeValue
documentAttributeValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [FacetResult]
facetResults