{-# 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.DataPipeline.Types.Operator where
import qualified Amazonka.Core as Core
import Amazonka.DataPipeline.Types.OperatorType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Operator = Operator'
{
Operator -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text],
Operator -> Maybe OperatorType
type' :: Prelude.Maybe OperatorType
}
deriving (Operator -> Operator -> Bool
(Operator -> Operator -> Bool)
-> (Operator -> Operator -> Bool) -> Eq Operator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Operator -> Operator -> Bool
$c/= :: Operator -> Operator -> Bool
== :: Operator -> Operator -> Bool
$c== :: Operator -> Operator -> Bool
Prelude.Eq, ReadPrec [Operator]
ReadPrec Operator
Int -> ReadS Operator
ReadS [Operator]
(Int -> ReadS Operator)
-> ReadS [Operator]
-> ReadPrec Operator
-> ReadPrec [Operator]
-> Read Operator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Operator]
$creadListPrec :: ReadPrec [Operator]
readPrec :: ReadPrec Operator
$creadPrec :: ReadPrec Operator
readList :: ReadS [Operator]
$creadList :: ReadS [Operator]
readsPrec :: Int -> ReadS Operator
$creadsPrec :: Int -> ReadS Operator
Prelude.Read, Int -> Operator -> ShowS
[Operator] -> ShowS
Operator -> String
(Int -> Operator -> ShowS)
-> (Operator -> String) -> ([Operator] -> ShowS) -> Show Operator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Operator] -> ShowS
$cshowList :: [Operator] -> ShowS
show :: Operator -> String
$cshow :: Operator -> String
showsPrec :: Int -> Operator -> ShowS
$cshowsPrec :: Int -> Operator -> ShowS
Prelude.Show, (forall x. Operator -> Rep Operator x)
-> (forall x. Rep Operator x -> Operator) -> Generic Operator
forall x. Rep Operator x -> Operator
forall x. Operator -> Rep Operator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Operator x -> Operator
$cfrom :: forall x. Operator -> Rep Operator x
Prelude.Generic)
newOperator ::
Operator
newOperator :: Operator
newOperator =
Operator' :: Maybe [Text] -> Maybe OperatorType -> Operator
Operator'
{ $sel:values:Operator' :: Maybe [Text]
values = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:type':Operator' :: Maybe OperatorType
type' = Maybe OperatorType
forall a. Maybe a
Prelude.Nothing
}
operator_values :: Lens.Lens' Operator (Prelude.Maybe [Prelude.Text])
operator_values :: (Maybe [Text] -> f (Maybe [Text])) -> Operator -> f Operator
operator_values = (Operator -> Maybe [Text])
-> (Operator -> Maybe [Text] -> Operator)
-> Lens Operator Operator (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operator' {Maybe [Text]
values :: Maybe [Text]
$sel:values:Operator' :: Operator -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: Operator
s@Operator' {} Maybe [Text]
a -> Operator
s {$sel:values:Operator' :: Maybe [Text]
values = Maybe [Text]
a} :: Operator) ((Maybe [Text] -> f (Maybe [Text])) -> Operator -> f Operator)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Operator
-> f Operator
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
operator_type :: Lens.Lens' Operator (Prelude.Maybe OperatorType)
operator_type :: (Maybe OperatorType -> f (Maybe OperatorType))
-> Operator -> f Operator
operator_type = (Operator -> Maybe OperatorType)
-> (Operator -> Maybe OperatorType -> Operator)
-> Lens Operator Operator (Maybe OperatorType) (Maybe OperatorType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Operator' {Maybe OperatorType
type' :: Maybe OperatorType
$sel:type':Operator' :: Operator -> Maybe OperatorType
type'} -> Maybe OperatorType
type') (\s :: Operator
s@Operator' {} Maybe OperatorType
a -> Operator
s {$sel:type':Operator' :: Maybe OperatorType
type' = Maybe OperatorType
a} :: Operator)
instance Prelude.Hashable Operator
instance Prelude.NFData Operator
instance Core.ToJSON Operator where
toJSON :: Operator -> Value
toJSON Operator' {Maybe [Text]
Maybe OperatorType
type' :: Maybe OperatorType
values :: Maybe [Text]
$sel:type':Operator' :: Operator -> Maybe OperatorType
$sel:values:Operator' :: Operator -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"values" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
values,
(Text
"type" Text -> OperatorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (OperatorType -> Pair) -> Maybe OperatorType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OperatorType
type'
]
)