{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataPipeline.Types.OperatorType
import qualified Amazonka.Prelude as Prelude
data Operator = Operator'
{
Operator -> Maybe OperatorType
type' :: Prelude.Maybe OperatorType,
Operator -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text]
}
deriving (Operator -> Operator -> Bool
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]
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
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. 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'
{ $sel:type':Operator' :: Maybe OperatorType
type' = forall a. Maybe a
Prelude.Nothing,
$sel:values:Operator' :: Maybe [Text]
values = forall a. Maybe a
Prelude.Nothing
}
operator_type :: Lens.Lens' Operator (Prelude.Maybe OperatorType)
operator_type :: Lens' Operator (Maybe OperatorType)
operator_type = 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)
operator_values :: Lens.Lens' Operator (Prelude.Maybe [Prelude.Text])
operator_values :: Lens' Operator (Maybe [Text])
operator_values = 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) 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 Prelude.Hashable Operator where
hashWithSalt :: Int -> Operator -> Int
hashWithSalt Int
_salt Operator' {Maybe [Text]
Maybe OperatorType
values :: Maybe [Text]
type' :: Maybe OperatorType
$sel:values:Operator' :: Operator -> Maybe [Text]
$sel:type':Operator' :: Operator -> Maybe OperatorType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OperatorType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
values
instance Prelude.NFData Operator where
rnf :: Operator -> ()
rnf Operator' {Maybe [Text]
Maybe OperatorType
values :: Maybe [Text]
type' :: Maybe OperatorType
$sel:values:Operator' :: Operator -> Maybe [Text]
$sel:type':Operator' :: Operator -> Maybe OperatorType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe OperatorType
type' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
values
instance Data.ToJSON Operator where
toJSON :: Operator -> Value
toJSON Operator' {Maybe [Text]
Maybe OperatorType
values :: Maybe [Text]
type' :: Maybe OperatorType
$sel:values:Operator' :: Operator -> Maybe [Text]
$sel:type':Operator' :: Operator -> Maybe OperatorType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"type" 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 OperatorType
type',
(Key
"values" 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]
values
]
)