{-# 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.CloudSearch.Types.DateArrayOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DateArrayOptions = DateArrayOptions'
{
DateArrayOptions -> Maybe Text
sourceFields :: Prelude.Maybe Prelude.Text,
DateArrayOptions -> Maybe Bool
returnEnabled :: Prelude.Maybe Prelude.Bool,
DateArrayOptions -> Maybe Bool
facetEnabled :: Prelude.Maybe Prelude.Bool,
DateArrayOptions -> Maybe Bool
searchEnabled :: Prelude.Maybe Prelude.Bool,
DateArrayOptions -> Maybe Text
defaultValue :: Prelude.Maybe Prelude.Text
}
deriving (DateArrayOptions -> DateArrayOptions -> Bool
(DateArrayOptions -> DateArrayOptions -> Bool)
-> (DateArrayOptions -> DateArrayOptions -> Bool)
-> Eq DateArrayOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DateArrayOptions -> DateArrayOptions -> Bool
$c/= :: DateArrayOptions -> DateArrayOptions -> Bool
== :: DateArrayOptions -> DateArrayOptions -> Bool
$c== :: DateArrayOptions -> DateArrayOptions -> Bool
Prelude.Eq, ReadPrec [DateArrayOptions]
ReadPrec DateArrayOptions
Int -> ReadS DateArrayOptions
ReadS [DateArrayOptions]
(Int -> ReadS DateArrayOptions)
-> ReadS [DateArrayOptions]
-> ReadPrec DateArrayOptions
-> ReadPrec [DateArrayOptions]
-> Read DateArrayOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DateArrayOptions]
$creadListPrec :: ReadPrec [DateArrayOptions]
readPrec :: ReadPrec DateArrayOptions
$creadPrec :: ReadPrec DateArrayOptions
readList :: ReadS [DateArrayOptions]
$creadList :: ReadS [DateArrayOptions]
readsPrec :: Int -> ReadS DateArrayOptions
$creadsPrec :: Int -> ReadS DateArrayOptions
Prelude.Read, Int -> DateArrayOptions -> ShowS
[DateArrayOptions] -> ShowS
DateArrayOptions -> String
(Int -> DateArrayOptions -> ShowS)
-> (DateArrayOptions -> String)
-> ([DateArrayOptions] -> ShowS)
-> Show DateArrayOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DateArrayOptions] -> ShowS
$cshowList :: [DateArrayOptions] -> ShowS
show :: DateArrayOptions -> String
$cshow :: DateArrayOptions -> String
showsPrec :: Int -> DateArrayOptions -> ShowS
$cshowsPrec :: Int -> DateArrayOptions -> ShowS
Prelude.Show, (forall x. DateArrayOptions -> Rep DateArrayOptions x)
-> (forall x. Rep DateArrayOptions x -> DateArrayOptions)
-> Generic DateArrayOptions
forall x. Rep DateArrayOptions x -> DateArrayOptions
forall x. DateArrayOptions -> Rep DateArrayOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DateArrayOptions x -> DateArrayOptions
$cfrom :: forall x. DateArrayOptions -> Rep DateArrayOptions x
Prelude.Generic)
newDateArrayOptions ::
DateArrayOptions
newDateArrayOptions :: DateArrayOptions
newDateArrayOptions =
DateArrayOptions' :: Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> DateArrayOptions
DateArrayOptions'
{ $sel:sourceFields:DateArrayOptions' :: Maybe Text
sourceFields = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:returnEnabled:DateArrayOptions' :: Maybe Bool
returnEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:facetEnabled:DateArrayOptions' :: Maybe Bool
facetEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:searchEnabled:DateArrayOptions' :: Maybe Bool
searchEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:defaultValue:DateArrayOptions' :: Maybe Text
defaultValue = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
dateArrayOptions_sourceFields :: Lens.Lens' DateArrayOptions (Prelude.Maybe Prelude.Text)
dateArrayOptions_sourceFields :: (Maybe Text -> f (Maybe Text))
-> DateArrayOptions -> f DateArrayOptions
dateArrayOptions_sourceFields = (DateArrayOptions -> Maybe Text)
-> (DateArrayOptions -> Maybe Text -> DateArrayOptions)
-> Lens DateArrayOptions DateArrayOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DateArrayOptions' {Maybe Text
sourceFields :: Maybe Text
$sel:sourceFields:DateArrayOptions' :: DateArrayOptions -> Maybe Text
sourceFields} -> Maybe Text
sourceFields) (\s :: DateArrayOptions
s@DateArrayOptions' {} Maybe Text
a -> DateArrayOptions
s {$sel:sourceFields:DateArrayOptions' :: Maybe Text
sourceFields = Maybe Text
a} :: DateArrayOptions)
dateArrayOptions_returnEnabled :: Lens.Lens' DateArrayOptions (Prelude.Maybe Prelude.Bool)
dateArrayOptions_returnEnabled :: (Maybe Bool -> f (Maybe Bool))
-> DateArrayOptions -> f DateArrayOptions
dateArrayOptions_returnEnabled = (DateArrayOptions -> Maybe Bool)
-> (DateArrayOptions -> Maybe Bool -> DateArrayOptions)
-> Lens DateArrayOptions DateArrayOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DateArrayOptions' {Maybe Bool
returnEnabled :: Maybe Bool
$sel:returnEnabled:DateArrayOptions' :: DateArrayOptions -> Maybe Bool
returnEnabled} -> Maybe Bool
returnEnabled) (\s :: DateArrayOptions
s@DateArrayOptions' {} Maybe Bool
a -> DateArrayOptions
s {$sel:returnEnabled:DateArrayOptions' :: Maybe Bool
returnEnabled = Maybe Bool
a} :: DateArrayOptions)
dateArrayOptions_facetEnabled :: Lens.Lens' DateArrayOptions (Prelude.Maybe Prelude.Bool)
dateArrayOptions_facetEnabled :: (Maybe Bool -> f (Maybe Bool))
-> DateArrayOptions -> f DateArrayOptions
dateArrayOptions_facetEnabled = (DateArrayOptions -> Maybe Bool)
-> (DateArrayOptions -> Maybe Bool -> DateArrayOptions)
-> Lens DateArrayOptions DateArrayOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DateArrayOptions' {Maybe Bool
facetEnabled :: Maybe Bool
$sel:facetEnabled:DateArrayOptions' :: DateArrayOptions -> Maybe Bool
facetEnabled} -> Maybe Bool
facetEnabled) (\s :: DateArrayOptions
s@DateArrayOptions' {} Maybe Bool
a -> DateArrayOptions
s {$sel:facetEnabled:DateArrayOptions' :: Maybe Bool
facetEnabled = Maybe Bool
a} :: DateArrayOptions)
dateArrayOptions_searchEnabled :: Lens.Lens' DateArrayOptions (Prelude.Maybe Prelude.Bool)
dateArrayOptions_searchEnabled :: (Maybe Bool -> f (Maybe Bool))
-> DateArrayOptions -> f DateArrayOptions
dateArrayOptions_searchEnabled = (DateArrayOptions -> Maybe Bool)
-> (DateArrayOptions -> Maybe Bool -> DateArrayOptions)
-> Lens DateArrayOptions DateArrayOptions (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DateArrayOptions' {Maybe Bool
searchEnabled :: Maybe Bool
$sel:searchEnabled:DateArrayOptions' :: DateArrayOptions -> Maybe Bool
searchEnabled} -> Maybe Bool
searchEnabled) (\s :: DateArrayOptions
s@DateArrayOptions' {} Maybe Bool
a -> DateArrayOptions
s {$sel:searchEnabled:DateArrayOptions' :: Maybe Bool
searchEnabled = Maybe Bool
a} :: DateArrayOptions)
dateArrayOptions_defaultValue :: Lens.Lens' DateArrayOptions (Prelude.Maybe Prelude.Text)
dateArrayOptions_defaultValue :: (Maybe Text -> f (Maybe Text))
-> DateArrayOptions -> f DateArrayOptions
dateArrayOptions_defaultValue = (DateArrayOptions -> Maybe Text)
-> (DateArrayOptions -> Maybe Text -> DateArrayOptions)
-> Lens DateArrayOptions DateArrayOptions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DateArrayOptions' {Maybe Text
defaultValue :: Maybe Text
$sel:defaultValue:DateArrayOptions' :: DateArrayOptions -> Maybe Text
defaultValue} -> Maybe Text
defaultValue) (\s :: DateArrayOptions
s@DateArrayOptions' {} Maybe Text
a -> DateArrayOptions
s {$sel:defaultValue:DateArrayOptions' :: Maybe Text
defaultValue = Maybe Text
a} :: DateArrayOptions)
instance Core.FromXML DateArrayOptions where
parseXML :: [Node] -> Either String DateArrayOptions
parseXML [Node]
x =
Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> DateArrayOptions
DateArrayOptions'
(Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> DateArrayOptions)
-> Either String (Maybe Text)
-> Either
String
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> Maybe Text -> DateArrayOptions)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SourceFields")
Either
String
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> Maybe Text -> DateArrayOptions)
-> Either String (Maybe Bool)
-> Either
String (Maybe Bool -> Maybe Bool -> Maybe Text -> DateArrayOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReturnEnabled")
Either
String (Maybe Bool -> Maybe Bool -> Maybe Text -> DateArrayOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> Maybe Text -> DateArrayOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FacetEnabled")
Either String (Maybe Bool -> Maybe Text -> DateArrayOptions)
-> Either String (Maybe Bool)
-> Either String (Maybe Text -> DateArrayOptions)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SearchEnabled")
Either String (Maybe Text -> DateArrayOptions)
-> Either String (Maybe Text) -> Either String DateArrayOptions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DefaultValue")
instance Prelude.Hashable DateArrayOptions
instance Prelude.NFData DateArrayOptions
instance Core.ToQuery DateArrayOptions where
toQuery :: DateArrayOptions -> QueryString
toQuery DateArrayOptions' {Maybe Bool
Maybe Text
defaultValue :: Maybe Text
searchEnabled :: Maybe Bool
facetEnabled :: Maybe Bool
returnEnabled :: Maybe Bool
sourceFields :: Maybe Text
$sel:defaultValue:DateArrayOptions' :: DateArrayOptions -> Maybe Text
$sel:searchEnabled:DateArrayOptions' :: DateArrayOptions -> Maybe Bool
$sel:facetEnabled:DateArrayOptions' :: DateArrayOptions -> Maybe Bool
$sel:returnEnabled:DateArrayOptions' :: DateArrayOptions -> Maybe Bool
$sel:sourceFields:DateArrayOptions' :: DateArrayOptions -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"SourceFields" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
sourceFields,
ByteString
"ReturnEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
returnEnabled,
ByteString
"FacetEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
facetEnabled,
ByteString
"SearchEnabled" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
searchEnabled,
ByteString
"DefaultValue" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
defaultValue
]