{-# 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.Organizations.Types.HandshakeFilter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Organizations.Types.ActionType
import qualified Amazonka.Prelude as Prelude
data HandshakeFilter = HandshakeFilter'
{
HandshakeFilter -> Maybe ActionType
actionType :: Prelude.Maybe ActionType,
HandshakeFilter -> Maybe Text
parentHandshakeId :: Prelude.Maybe Prelude.Text
}
deriving (HandshakeFilter -> HandshakeFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandshakeFilter -> HandshakeFilter -> Bool
$c/= :: HandshakeFilter -> HandshakeFilter -> Bool
== :: HandshakeFilter -> HandshakeFilter -> Bool
$c== :: HandshakeFilter -> HandshakeFilter -> Bool
Prelude.Eq, ReadPrec [HandshakeFilter]
ReadPrec HandshakeFilter
Int -> ReadS HandshakeFilter
ReadS [HandshakeFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HandshakeFilter]
$creadListPrec :: ReadPrec [HandshakeFilter]
readPrec :: ReadPrec HandshakeFilter
$creadPrec :: ReadPrec HandshakeFilter
readList :: ReadS [HandshakeFilter]
$creadList :: ReadS [HandshakeFilter]
readsPrec :: Int -> ReadS HandshakeFilter
$creadsPrec :: Int -> ReadS HandshakeFilter
Prelude.Read, Int -> HandshakeFilter -> ShowS
[HandshakeFilter] -> ShowS
HandshakeFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HandshakeFilter] -> ShowS
$cshowList :: [HandshakeFilter] -> ShowS
show :: HandshakeFilter -> String
$cshow :: HandshakeFilter -> String
showsPrec :: Int -> HandshakeFilter -> ShowS
$cshowsPrec :: Int -> HandshakeFilter -> ShowS
Prelude.Show, forall x. Rep HandshakeFilter x -> HandshakeFilter
forall x. HandshakeFilter -> Rep HandshakeFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HandshakeFilter x -> HandshakeFilter
$cfrom :: forall x. HandshakeFilter -> Rep HandshakeFilter x
Prelude.Generic)
newHandshakeFilter ::
HandshakeFilter
newHandshakeFilter :: HandshakeFilter
newHandshakeFilter =
HandshakeFilter'
{ $sel:actionType:HandshakeFilter' :: Maybe ActionType
actionType = forall a. Maybe a
Prelude.Nothing,
$sel:parentHandshakeId:HandshakeFilter' :: Maybe Text
parentHandshakeId = forall a. Maybe a
Prelude.Nothing
}
handshakeFilter_actionType :: Lens.Lens' HandshakeFilter (Prelude.Maybe ActionType)
handshakeFilter_actionType :: Lens' HandshakeFilter (Maybe ActionType)
handshakeFilter_actionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HandshakeFilter' {Maybe ActionType
actionType :: Maybe ActionType
$sel:actionType:HandshakeFilter' :: HandshakeFilter -> Maybe ActionType
actionType} -> Maybe ActionType
actionType) (\s :: HandshakeFilter
s@HandshakeFilter' {} Maybe ActionType
a -> HandshakeFilter
s {$sel:actionType:HandshakeFilter' :: Maybe ActionType
actionType = Maybe ActionType
a} :: HandshakeFilter)
handshakeFilter_parentHandshakeId :: Lens.Lens' HandshakeFilter (Prelude.Maybe Prelude.Text)
handshakeFilter_parentHandshakeId :: Lens' HandshakeFilter (Maybe Text)
handshakeFilter_parentHandshakeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HandshakeFilter' {Maybe Text
parentHandshakeId :: Maybe Text
$sel:parentHandshakeId:HandshakeFilter' :: HandshakeFilter -> Maybe Text
parentHandshakeId} -> Maybe Text
parentHandshakeId) (\s :: HandshakeFilter
s@HandshakeFilter' {} Maybe Text
a -> HandshakeFilter
s {$sel:parentHandshakeId:HandshakeFilter' :: Maybe Text
parentHandshakeId = Maybe Text
a} :: HandshakeFilter)
instance Prelude.Hashable HandshakeFilter where
hashWithSalt :: Int -> HandshakeFilter -> Int
hashWithSalt Int
_salt HandshakeFilter' {Maybe Text
Maybe ActionType
parentHandshakeId :: Maybe Text
actionType :: Maybe ActionType
$sel:parentHandshakeId:HandshakeFilter' :: HandshakeFilter -> Maybe Text
$sel:actionType:HandshakeFilter' :: HandshakeFilter -> Maybe ActionType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ActionType
actionType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parentHandshakeId
instance Prelude.NFData HandshakeFilter where
rnf :: HandshakeFilter -> ()
rnf HandshakeFilter' {Maybe Text
Maybe ActionType
parentHandshakeId :: Maybe Text
actionType :: Maybe ActionType
$sel:parentHandshakeId:HandshakeFilter' :: HandshakeFilter -> Maybe Text
$sel:actionType:HandshakeFilter' :: HandshakeFilter -> Maybe ActionType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ActionType
actionType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parentHandshakeId
instance Data.ToJSON HandshakeFilter where
toJSON :: HandshakeFilter -> Value
toJSON HandshakeFilter' {Maybe Text
Maybe ActionType
parentHandshakeId :: Maybe Text
actionType :: Maybe ActionType
$sel:parentHandshakeId:HandshakeFilter' :: HandshakeFilter -> Maybe Text
$sel:actionType:HandshakeFilter' :: HandshakeFilter -> Maybe ActionType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ActionType" 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 ActionType
actionType,
(Key
"ParentHandshakeId" 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
parentHandshakeId
]
)