{-# 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.AppFlow.Types.FieldTypeDetails where
import Amazonka.AppFlow.Types.Operator
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FieldTypeDetails = FieldTypeDetails'
{
FieldTypeDetails -> Maybe [Text]
supportedValues :: Prelude.Maybe [Prelude.Text],
FieldTypeDetails -> Text
fieldType :: Prelude.Text,
FieldTypeDetails -> [Operator]
filterOperators :: [Operator]
}
deriving (FieldTypeDetails -> FieldTypeDetails -> Bool
(FieldTypeDetails -> FieldTypeDetails -> Bool)
-> (FieldTypeDetails -> FieldTypeDetails -> Bool)
-> Eq FieldTypeDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldTypeDetails -> FieldTypeDetails -> Bool
$c/= :: FieldTypeDetails -> FieldTypeDetails -> Bool
== :: FieldTypeDetails -> FieldTypeDetails -> Bool
$c== :: FieldTypeDetails -> FieldTypeDetails -> Bool
Prelude.Eq, ReadPrec [FieldTypeDetails]
ReadPrec FieldTypeDetails
Int -> ReadS FieldTypeDetails
ReadS [FieldTypeDetails]
(Int -> ReadS FieldTypeDetails)
-> ReadS [FieldTypeDetails]
-> ReadPrec FieldTypeDetails
-> ReadPrec [FieldTypeDetails]
-> Read FieldTypeDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FieldTypeDetails]
$creadListPrec :: ReadPrec [FieldTypeDetails]
readPrec :: ReadPrec FieldTypeDetails
$creadPrec :: ReadPrec FieldTypeDetails
readList :: ReadS [FieldTypeDetails]
$creadList :: ReadS [FieldTypeDetails]
readsPrec :: Int -> ReadS FieldTypeDetails
$creadsPrec :: Int -> ReadS FieldTypeDetails
Prelude.Read, Int -> FieldTypeDetails -> ShowS
[FieldTypeDetails] -> ShowS
FieldTypeDetails -> String
(Int -> FieldTypeDetails -> ShowS)
-> (FieldTypeDetails -> String)
-> ([FieldTypeDetails] -> ShowS)
-> Show FieldTypeDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldTypeDetails] -> ShowS
$cshowList :: [FieldTypeDetails] -> ShowS
show :: FieldTypeDetails -> String
$cshow :: FieldTypeDetails -> String
showsPrec :: Int -> FieldTypeDetails -> ShowS
$cshowsPrec :: Int -> FieldTypeDetails -> ShowS
Prelude.Show, (forall x. FieldTypeDetails -> Rep FieldTypeDetails x)
-> (forall x. Rep FieldTypeDetails x -> FieldTypeDetails)
-> Generic FieldTypeDetails
forall x. Rep FieldTypeDetails x -> FieldTypeDetails
forall x. FieldTypeDetails -> Rep FieldTypeDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FieldTypeDetails x -> FieldTypeDetails
$cfrom :: forall x. FieldTypeDetails -> Rep FieldTypeDetails x
Prelude.Generic)
newFieldTypeDetails ::
Prelude.Text ->
FieldTypeDetails
newFieldTypeDetails :: Text -> FieldTypeDetails
newFieldTypeDetails Text
pFieldType_ =
FieldTypeDetails' :: Maybe [Text] -> Text -> [Operator] -> FieldTypeDetails
FieldTypeDetails'
{ $sel:supportedValues:FieldTypeDetails' :: Maybe [Text]
supportedValues =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:fieldType:FieldTypeDetails' :: Text
fieldType = Text
pFieldType_,
$sel:filterOperators:FieldTypeDetails' :: [Operator]
filterOperators = [Operator]
forall a. Monoid a => a
Prelude.mempty
}
fieldTypeDetails_supportedValues :: Lens.Lens' FieldTypeDetails (Prelude.Maybe [Prelude.Text])
fieldTypeDetails_supportedValues :: (Maybe [Text] -> f (Maybe [Text]))
-> FieldTypeDetails -> f FieldTypeDetails
fieldTypeDetails_supportedValues = (FieldTypeDetails -> Maybe [Text])
-> (FieldTypeDetails -> Maybe [Text] -> FieldTypeDetails)
-> Lens
FieldTypeDetails FieldTypeDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldTypeDetails' {Maybe [Text]
supportedValues :: Maybe [Text]
$sel:supportedValues:FieldTypeDetails' :: FieldTypeDetails -> Maybe [Text]
supportedValues} -> Maybe [Text]
supportedValues) (\s :: FieldTypeDetails
s@FieldTypeDetails' {} Maybe [Text]
a -> FieldTypeDetails
s {$sel:supportedValues:FieldTypeDetails' :: Maybe [Text]
supportedValues = Maybe [Text]
a} :: FieldTypeDetails) ((Maybe [Text] -> f (Maybe [Text]))
-> FieldTypeDetails -> f FieldTypeDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> FieldTypeDetails
-> f FieldTypeDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
fieldTypeDetails_fieldType :: Lens.Lens' FieldTypeDetails Prelude.Text
fieldTypeDetails_fieldType :: (Text -> f Text) -> FieldTypeDetails -> f FieldTypeDetails
fieldTypeDetails_fieldType = (FieldTypeDetails -> Text)
-> (FieldTypeDetails -> Text -> FieldTypeDetails)
-> Lens FieldTypeDetails FieldTypeDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldTypeDetails' {Text
fieldType :: Text
$sel:fieldType:FieldTypeDetails' :: FieldTypeDetails -> Text
fieldType} -> Text
fieldType) (\s :: FieldTypeDetails
s@FieldTypeDetails' {} Text
a -> FieldTypeDetails
s {$sel:fieldType:FieldTypeDetails' :: Text
fieldType = Text
a} :: FieldTypeDetails)
fieldTypeDetails_filterOperators :: Lens.Lens' FieldTypeDetails [Operator]
fieldTypeDetails_filterOperators :: ([Operator] -> f [Operator])
-> FieldTypeDetails -> f FieldTypeDetails
fieldTypeDetails_filterOperators = (FieldTypeDetails -> [Operator])
-> (FieldTypeDetails -> [Operator] -> FieldTypeDetails)
-> Lens FieldTypeDetails FieldTypeDetails [Operator] [Operator]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldTypeDetails' {[Operator]
filterOperators :: [Operator]
$sel:filterOperators:FieldTypeDetails' :: FieldTypeDetails -> [Operator]
filterOperators} -> [Operator]
filterOperators) (\s :: FieldTypeDetails
s@FieldTypeDetails' {} [Operator]
a -> FieldTypeDetails
s {$sel:filterOperators:FieldTypeDetails' :: [Operator]
filterOperators = [Operator]
a} :: FieldTypeDetails) (([Operator] -> f [Operator])
-> FieldTypeDetails -> f FieldTypeDetails)
-> (([Operator] -> f [Operator]) -> [Operator] -> f [Operator])
-> ([Operator] -> f [Operator])
-> FieldTypeDetails
-> f FieldTypeDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Operator] -> f [Operator]) -> [Operator] -> f [Operator]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON FieldTypeDetails where
parseJSON :: Value -> Parser FieldTypeDetails
parseJSON =
String
-> (Object -> Parser FieldTypeDetails)
-> Value
-> Parser FieldTypeDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FieldTypeDetails"
( \Object
x ->
Maybe [Text] -> Text -> [Operator] -> FieldTypeDetails
FieldTypeDetails'
(Maybe [Text] -> Text -> [Operator] -> FieldTypeDetails)
-> Parser (Maybe [Text])
-> Parser (Text -> [Operator] -> FieldTypeDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"supportedValues"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Text -> [Operator] -> FieldTypeDetails)
-> Parser Text -> Parser ([Operator] -> FieldTypeDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"fieldType")
Parser ([Operator] -> FieldTypeDetails)
-> Parser [Operator] -> Parser FieldTypeDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [Operator])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"filterOperators"
Parser (Maybe [Operator]) -> [Operator] -> Parser [Operator]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Operator]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable FieldTypeDetails
instance Prelude.NFData FieldTypeDetails