{-# 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.HandshakeParty 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.HandshakePartyType
import qualified Amazonka.Prelude as Prelude
data HandshakeParty = HandshakeParty'
{
HandshakeParty -> Sensitive Text
id :: Data.Sensitive Prelude.Text,
HandshakeParty -> HandshakePartyType
type' :: HandshakePartyType
}
deriving (HandshakeParty -> HandshakeParty -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandshakeParty -> HandshakeParty -> Bool
$c/= :: HandshakeParty -> HandshakeParty -> Bool
== :: HandshakeParty -> HandshakeParty -> Bool
$c== :: HandshakeParty -> HandshakeParty -> Bool
Prelude.Eq, Int -> HandshakeParty -> ShowS
[HandshakeParty] -> ShowS
HandshakeParty -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HandshakeParty] -> ShowS
$cshowList :: [HandshakeParty] -> ShowS
show :: HandshakeParty -> String
$cshow :: HandshakeParty -> String
showsPrec :: Int -> HandshakeParty -> ShowS
$cshowsPrec :: Int -> HandshakeParty -> ShowS
Prelude.Show, forall x. Rep HandshakeParty x -> HandshakeParty
forall x. HandshakeParty -> Rep HandshakeParty x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HandshakeParty x -> HandshakeParty
$cfrom :: forall x. HandshakeParty -> Rep HandshakeParty x
Prelude.Generic)
newHandshakeParty ::
Prelude.Text ->
HandshakePartyType ->
HandshakeParty
newHandshakeParty :: Text -> HandshakePartyType -> HandshakeParty
newHandshakeParty Text
pId_ HandshakePartyType
pType_ =
HandshakeParty'
{ $sel:id:HandshakeParty' :: Sensitive Text
id = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pId_,
$sel:type':HandshakeParty' :: HandshakePartyType
type' = HandshakePartyType
pType_
}
handshakeParty_id :: Lens.Lens' HandshakeParty Prelude.Text
handshakeParty_id :: Lens' HandshakeParty Text
handshakeParty_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HandshakeParty' {Sensitive Text
id :: Sensitive Text
$sel:id:HandshakeParty' :: HandshakeParty -> Sensitive Text
id} -> Sensitive Text
id) (\s :: HandshakeParty
s@HandshakeParty' {} Sensitive Text
a -> HandshakeParty
s {$sel:id:HandshakeParty' :: Sensitive Text
id = Sensitive Text
a} :: HandshakeParty) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
handshakeParty_type :: Lens.Lens' HandshakeParty HandshakePartyType
handshakeParty_type :: Lens' HandshakeParty HandshakePartyType
handshakeParty_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HandshakeParty' {HandshakePartyType
type' :: HandshakePartyType
$sel:type':HandshakeParty' :: HandshakeParty -> HandshakePartyType
type'} -> HandshakePartyType
type') (\s :: HandshakeParty
s@HandshakeParty' {} HandshakePartyType
a -> HandshakeParty
s {$sel:type':HandshakeParty' :: HandshakePartyType
type' = HandshakePartyType
a} :: HandshakeParty)
instance Data.FromJSON HandshakeParty where
parseJSON :: Value -> Parser HandshakeParty
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HandshakeParty"
( \Object
x ->
Sensitive Text -> HandshakePartyType -> HandshakeParty
HandshakeParty'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Type")
)
instance Prelude.Hashable HandshakeParty where
hashWithSalt :: Int -> HandshakeParty -> Int
hashWithSalt Int
_salt HandshakeParty' {Sensitive Text
HandshakePartyType
type' :: HandshakePartyType
id :: Sensitive Text
$sel:type':HandshakeParty' :: HandshakeParty -> HandshakePartyType
$sel:id:HandshakeParty' :: HandshakeParty -> Sensitive Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HandshakePartyType
type'
instance Prelude.NFData HandshakeParty where
rnf :: HandshakeParty -> ()
rnf HandshakeParty' {Sensitive Text
HandshakePartyType
type' :: HandshakePartyType
id :: Sensitive Text
$sel:type':HandshakeParty' :: HandshakeParty -> HandshakePartyType
$sel:id:HandshakeParty' :: HandshakeParty -> Sensitive Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HandshakePartyType
type'
instance Data.ToJSON HandshakeParty where
toJSON :: HandshakeParty -> Value
toJSON HandshakeParty' {Sensitive Text
HandshakePartyType
type' :: HandshakePartyType
id :: Sensitive Text
$sel:type':HandshakeParty' :: HandshakeParty -> HandshakePartyType
$sel:id:HandshakeParty' :: HandshakeParty -> Sensitive Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
id),
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HandshakePartyType
type')
]
)