{-# 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.S3.Types.Initiator where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data Initiator = Initiator'
{
Initiator -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
Initiator -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (Initiator -> Initiator -> Bool
(Initiator -> Initiator -> Bool)
-> (Initiator -> Initiator -> Bool) -> Eq Initiator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Initiator -> Initiator -> Bool
$c/= :: Initiator -> Initiator -> Bool
== :: Initiator -> Initiator -> Bool
$c== :: Initiator -> Initiator -> Bool
Prelude.Eq, ReadPrec [Initiator]
ReadPrec Initiator
Int -> ReadS Initiator
ReadS [Initiator]
(Int -> ReadS Initiator)
-> ReadS [Initiator]
-> ReadPrec Initiator
-> ReadPrec [Initiator]
-> Read Initiator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Initiator]
$creadListPrec :: ReadPrec [Initiator]
readPrec :: ReadPrec Initiator
$creadPrec :: ReadPrec Initiator
readList :: ReadS [Initiator]
$creadList :: ReadS [Initiator]
readsPrec :: Int -> ReadS Initiator
$creadsPrec :: Int -> ReadS Initiator
Prelude.Read, Int -> Initiator -> ShowS
[Initiator] -> ShowS
Initiator -> String
(Int -> Initiator -> ShowS)
-> (Initiator -> String)
-> ([Initiator] -> ShowS)
-> Show Initiator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Initiator] -> ShowS
$cshowList :: [Initiator] -> ShowS
show :: Initiator -> String
$cshow :: Initiator -> String
showsPrec :: Int -> Initiator -> ShowS
$cshowsPrec :: Int -> Initiator -> ShowS
Prelude.Show, (forall x. Initiator -> Rep Initiator x)
-> (forall x. Rep Initiator x -> Initiator) -> Generic Initiator
forall x. Rep Initiator x -> Initiator
forall x. Initiator -> Rep Initiator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Initiator x -> Initiator
$cfrom :: forall x. Initiator -> Rep Initiator x
Prelude.Generic)
newInitiator ::
Initiator
newInitiator :: Initiator
newInitiator =
Initiator' :: Maybe Text -> Maybe Text -> Initiator
Initiator'
{ $sel:displayName:Initiator' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Initiator' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
initiator_displayName :: Lens.Lens' Initiator (Prelude.Maybe Prelude.Text)
initiator_displayName :: (Maybe Text -> f (Maybe Text)) -> Initiator -> f Initiator
initiator_displayName = (Initiator -> Maybe Text)
-> (Initiator -> Maybe Text -> Initiator)
-> Lens Initiator Initiator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Initiator' {Maybe Text
displayName :: Maybe Text
$sel:displayName:Initiator' :: Initiator -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: Initiator
s@Initiator' {} Maybe Text
a -> Initiator
s {$sel:displayName:Initiator' :: Maybe Text
displayName = Maybe Text
a} :: Initiator)
initiator_id :: Lens.Lens' Initiator (Prelude.Maybe Prelude.Text)
initiator_id :: (Maybe Text -> f (Maybe Text)) -> Initiator -> f Initiator
initiator_id = (Initiator -> Maybe Text)
-> (Initiator -> Maybe Text -> Initiator)
-> Lens Initiator Initiator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Initiator' {Maybe Text
id :: Maybe Text
$sel:id:Initiator' :: Initiator -> Maybe Text
id} -> Maybe Text
id) (\s :: Initiator
s@Initiator' {} Maybe Text
a -> Initiator
s {$sel:id:Initiator' :: Maybe Text
id = Maybe Text
a} :: Initiator)
instance Core.FromXML Initiator where
parseXML :: [Node] -> Either String Initiator
parseXML [Node]
x =
Maybe Text -> Maybe Text -> Initiator
Initiator'
(Maybe Text -> Maybe Text -> Initiator)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Initiator)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DisplayName")
Either String (Maybe Text -> Initiator)
-> Either String (Maybe Text) -> Either String Initiator
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ID")
instance Prelude.Hashable Initiator
instance Prelude.NFData Initiator