{-# 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.CertificateManagerPCA.Types.EdiPartyName where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EdiPartyName = EdiPartyName'
{
EdiPartyName -> Maybe Text
nameAssigner :: Prelude.Maybe Prelude.Text,
EdiPartyName -> Text
partyName :: Prelude.Text
}
deriving (EdiPartyName -> EdiPartyName -> Bool
(EdiPartyName -> EdiPartyName -> Bool)
-> (EdiPartyName -> EdiPartyName -> Bool) -> Eq EdiPartyName
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EdiPartyName -> EdiPartyName -> Bool
$c/= :: EdiPartyName -> EdiPartyName -> Bool
== :: EdiPartyName -> EdiPartyName -> Bool
$c== :: EdiPartyName -> EdiPartyName -> Bool
Prelude.Eq, ReadPrec [EdiPartyName]
ReadPrec EdiPartyName
Int -> ReadS EdiPartyName
ReadS [EdiPartyName]
(Int -> ReadS EdiPartyName)
-> ReadS [EdiPartyName]
-> ReadPrec EdiPartyName
-> ReadPrec [EdiPartyName]
-> Read EdiPartyName
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EdiPartyName]
$creadListPrec :: ReadPrec [EdiPartyName]
readPrec :: ReadPrec EdiPartyName
$creadPrec :: ReadPrec EdiPartyName
readList :: ReadS [EdiPartyName]
$creadList :: ReadS [EdiPartyName]
readsPrec :: Int -> ReadS EdiPartyName
$creadsPrec :: Int -> ReadS EdiPartyName
Prelude.Read, Int -> EdiPartyName -> ShowS
[EdiPartyName] -> ShowS
EdiPartyName -> String
(Int -> EdiPartyName -> ShowS)
-> (EdiPartyName -> String)
-> ([EdiPartyName] -> ShowS)
-> Show EdiPartyName
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EdiPartyName] -> ShowS
$cshowList :: [EdiPartyName] -> ShowS
show :: EdiPartyName -> String
$cshow :: EdiPartyName -> String
showsPrec :: Int -> EdiPartyName -> ShowS
$cshowsPrec :: Int -> EdiPartyName -> ShowS
Prelude.Show, (forall x. EdiPartyName -> Rep EdiPartyName x)
-> (forall x. Rep EdiPartyName x -> EdiPartyName)
-> Generic EdiPartyName
forall x. Rep EdiPartyName x -> EdiPartyName
forall x. EdiPartyName -> Rep EdiPartyName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EdiPartyName x -> EdiPartyName
$cfrom :: forall x. EdiPartyName -> Rep EdiPartyName x
Prelude.Generic)
newEdiPartyName ::
Prelude.Text ->
EdiPartyName
newEdiPartyName :: Text -> EdiPartyName
newEdiPartyName Text
pPartyName_ =
EdiPartyName' :: Maybe Text -> Text -> EdiPartyName
EdiPartyName'
{ $sel:nameAssigner:EdiPartyName' :: Maybe Text
nameAssigner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:partyName:EdiPartyName' :: Text
partyName = Text
pPartyName_
}
ediPartyName_nameAssigner :: Lens.Lens' EdiPartyName (Prelude.Maybe Prelude.Text)
ediPartyName_nameAssigner :: (Maybe Text -> f (Maybe Text)) -> EdiPartyName -> f EdiPartyName
ediPartyName_nameAssigner = (EdiPartyName -> Maybe Text)
-> (EdiPartyName -> Maybe Text -> EdiPartyName)
-> Lens EdiPartyName EdiPartyName (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdiPartyName' {Maybe Text
nameAssigner :: Maybe Text
$sel:nameAssigner:EdiPartyName' :: EdiPartyName -> Maybe Text
nameAssigner} -> Maybe Text
nameAssigner) (\s :: EdiPartyName
s@EdiPartyName' {} Maybe Text
a -> EdiPartyName
s {$sel:nameAssigner:EdiPartyName' :: Maybe Text
nameAssigner = Maybe Text
a} :: EdiPartyName)
ediPartyName_partyName :: Lens.Lens' EdiPartyName Prelude.Text
ediPartyName_partyName :: (Text -> f Text) -> EdiPartyName -> f EdiPartyName
ediPartyName_partyName = (EdiPartyName -> Text)
-> (EdiPartyName -> Text -> EdiPartyName)
-> Lens EdiPartyName EdiPartyName Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdiPartyName' {Text
partyName :: Text
$sel:partyName:EdiPartyName' :: EdiPartyName -> Text
partyName} -> Text
partyName) (\s :: EdiPartyName
s@EdiPartyName' {} Text
a -> EdiPartyName
s {$sel:partyName:EdiPartyName' :: Text
partyName = Text
a} :: EdiPartyName)
instance Core.FromJSON EdiPartyName where
parseJSON :: Value -> Parser EdiPartyName
parseJSON =
String
-> (Object -> Parser EdiPartyName) -> Value -> Parser EdiPartyName
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EdiPartyName"
( \Object
x ->
Maybe Text -> Text -> EdiPartyName
EdiPartyName'
(Maybe Text -> Text -> EdiPartyName)
-> Parser (Maybe Text) -> Parser (Text -> EdiPartyName)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NameAssigner")
Parser (Text -> EdiPartyName) -> Parser Text -> Parser EdiPartyName
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
"PartyName")
)
instance Prelude.Hashable EdiPartyName
instance Prelude.NFData EdiPartyName
instance Core.ToJSON EdiPartyName where
toJSON :: EdiPartyName -> Value
toJSON EdiPartyName' {Maybe Text
Text
partyName :: Text
nameAssigner :: Maybe Text
$sel:partyName:EdiPartyName' :: EdiPartyName -> Text
$sel:nameAssigner:EdiPartyName' :: EdiPartyName -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NameAssigner" 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
nameAssigner,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"PartyName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
partyName)
]
)