{-# 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.Facet where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Facet = Facet'
{
Facet -> Maybe Text
documentAttributeKey :: Prelude.Maybe Prelude.Text,
Facet -> Maybe [Facet]
facets :: Prelude.Maybe [Facet],
Facet -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (Facet -> Facet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Facet -> Facet -> Bool
$c/= :: Facet -> Facet -> Bool
== :: Facet -> Facet -> Bool
$c== :: Facet -> Facet -> Bool
Prelude.Eq, ReadPrec [Facet]
ReadPrec Facet
Int -> ReadS Facet
ReadS [Facet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Facet]
$creadListPrec :: ReadPrec [Facet]
readPrec :: ReadPrec Facet
$creadPrec :: ReadPrec Facet
readList :: ReadS [Facet]
$creadList :: ReadS [Facet]
readsPrec :: Int -> ReadS Facet
$creadsPrec :: Int -> ReadS Facet
Prelude.Read, Int -> Facet -> ShowS
[Facet] -> ShowS
Facet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Facet] -> ShowS
$cshowList :: [Facet] -> ShowS
show :: Facet -> String
$cshow :: Facet -> String
showsPrec :: Int -> Facet -> ShowS
$cshowsPrec :: Int -> Facet -> ShowS
Prelude.Show, forall x. Rep Facet x -> Facet
forall x. Facet -> Rep Facet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Facet x -> Facet
$cfrom :: forall x. Facet -> Rep Facet x
Prelude.Generic)
newFacet ::
Facet
newFacet :: Facet
newFacet =
Facet'
{ $sel:documentAttributeKey:Facet' :: Maybe Text
documentAttributeKey = forall a. Maybe a
Prelude.Nothing,
$sel:facets:Facet' :: Maybe [Facet]
facets = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:Facet' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing
}
facet_documentAttributeKey :: Lens.Lens' Facet (Prelude.Maybe Prelude.Text)
facet_documentAttributeKey :: Lens' Facet (Maybe Text)
facet_documentAttributeKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Facet' {Maybe Text
documentAttributeKey :: Maybe Text
$sel:documentAttributeKey:Facet' :: Facet -> Maybe Text
documentAttributeKey} -> Maybe Text
documentAttributeKey) (\s :: Facet
s@Facet' {} Maybe Text
a -> Facet
s {$sel:documentAttributeKey:Facet' :: Maybe Text
documentAttributeKey = Maybe Text
a} :: Facet)
facet_facets :: Lens.Lens' Facet (Prelude.Maybe [Facet])
facet_facets :: Lens' Facet (Maybe [Facet])
facet_facets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Facet' {Maybe [Facet]
facets :: Maybe [Facet]
$sel:facets:Facet' :: Facet -> Maybe [Facet]
facets} -> Maybe [Facet]
facets) (\s :: Facet
s@Facet' {} Maybe [Facet]
a -> Facet
s {$sel:facets:Facet' :: Maybe [Facet]
facets = Maybe [Facet]
a} :: Facet) 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
facet_maxResults :: Lens.Lens' Facet (Prelude.Maybe Prelude.Natural)
facet_maxResults :: Lens' Facet (Maybe Natural)
facet_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Facet' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:Facet' :: Facet -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: Facet
s@Facet' {} Maybe Natural
a -> Facet
s {$sel:maxResults:Facet' :: Maybe Natural
maxResults = Maybe Natural
a} :: Facet)
instance Prelude.Hashable Facet where
hashWithSalt :: Int -> Facet -> Int
hashWithSalt Int
_salt Facet' {Maybe Natural
Maybe [Facet]
Maybe Text
maxResults :: Maybe Natural
facets :: Maybe [Facet]
documentAttributeKey :: Maybe Text
$sel:maxResults:Facet' :: Facet -> Maybe Natural
$sel:facets:Facet' :: Facet -> Maybe [Facet]
$sel:documentAttributeKey:Facet' :: Facet -> 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 [Facet]
facets
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
instance Prelude.NFData Facet where
rnf :: Facet -> ()
rnf Facet' {Maybe Natural
Maybe [Facet]
Maybe Text
maxResults :: Maybe Natural
facets :: Maybe [Facet]
documentAttributeKey :: Maybe Text
$sel:maxResults:Facet' :: Facet -> Maybe Natural
$sel:facets:Facet' :: Facet -> Maybe [Facet]
$sel:documentAttributeKey:Facet' :: Facet -> 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 [Facet]
facets
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
instance Data.ToJSON Facet where
toJSON :: Facet -> Value
toJSON Facet' {Maybe Natural
Maybe [Facet]
Maybe Text
maxResults :: Maybe Natural
facets :: Maybe [Facet]
documentAttributeKey :: Maybe Text
$sel:maxResults:Facet' :: Facet -> Maybe Natural
$sel:facets:Facet' :: Facet -> Maybe [Facet]
$sel:documentAttributeKey:Facet' :: Facet -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DocumentAttributeKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
documentAttributeKey,
(Key
"Facets" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Facet]
facets,
(Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)