{-# 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.IAM.Types.SigningCertificate where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types.StatusType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SigningCertificate = SigningCertificate'
{
SigningCertificate -> Maybe ISO8601
uploadDate :: Prelude.Maybe Core.ISO8601,
SigningCertificate -> Text
userName :: Prelude.Text,
SigningCertificate -> Text
certificateId :: Prelude.Text,
SigningCertificate -> Text
certificateBody :: Prelude.Text,
SigningCertificate -> StatusType
status :: StatusType
}
deriving (SigningCertificate -> SigningCertificate -> Bool
(SigningCertificate -> SigningCertificate -> Bool)
-> (SigningCertificate -> SigningCertificate -> Bool)
-> Eq SigningCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SigningCertificate -> SigningCertificate -> Bool
$c/= :: SigningCertificate -> SigningCertificate -> Bool
== :: SigningCertificate -> SigningCertificate -> Bool
$c== :: SigningCertificate -> SigningCertificate -> Bool
Prelude.Eq, ReadPrec [SigningCertificate]
ReadPrec SigningCertificate
Int -> ReadS SigningCertificate
ReadS [SigningCertificate]
(Int -> ReadS SigningCertificate)
-> ReadS [SigningCertificate]
-> ReadPrec SigningCertificate
-> ReadPrec [SigningCertificate]
-> Read SigningCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SigningCertificate]
$creadListPrec :: ReadPrec [SigningCertificate]
readPrec :: ReadPrec SigningCertificate
$creadPrec :: ReadPrec SigningCertificate
readList :: ReadS [SigningCertificate]
$creadList :: ReadS [SigningCertificate]
readsPrec :: Int -> ReadS SigningCertificate
$creadsPrec :: Int -> ReadS SigningCertificate
Prelude.Read, Int -> SigningCertificate -> ShowS
[SigningCertificate] -> ShowS
SigningCertificate -> String
(Int -> SigningCertificate -> ShowS)
-> (SigningCertificate -> String)
-> ([SigningCertificate] -> ShowS)
-> Show SigningCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigningCertificate] -> ShowS
$cshowList :: [SigningCertificate] -> ShowS
show :: SigningCertificate -> String
$cshow :: SigningCertificate -> String
showsPrec :: Int -> SigningCertificate -> ShowS
$cshowsPrec :: Int -> SigningCertificate -> ShowS
Prelude.Show, (forall x. SigningCertificate -> Rep SigningCertificate x)
-> (forall x. Rep SigningCertificate x -> SigningCertificate)
-> Generic SigningCertificate
forall x. Rep SigningCertificate x -> SigningCertificate
forall x. SigningCertificate -> Rep SigningCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SigningCertificate x -> SigningCertificate
$cfrom :: forall x. SigningCertificate -> Rep SigningCertificate x
Prelude.Generic)
newSigningCertificate ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StatusType ->
SigningCertificate
newSigningCertificate :: Text -> Text -> Text -> StatusType -> SigningCertificate
newSigningCertificate
Text
pUserName_
Text
pCertificateId_
Text
pCertificateBody_
StatusType
pStatus_ =
SigningCertificate' :: Maybe ISO8601
-> Text -> Text -> Text -> StatusType -> SigningCertificate
SigningCertificate'
{ $sel:uploadDate:SigningCertificate' :: Maybe ISO8601
uploadDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:userName:SigningCertificate' :: Text
userName = Text
pUserName_,
$sel:certificateId:SigningCertificate' :: Text
certificateId = Text
pCertificateId_,
$sel:certificateBody:SigningCertificate' :: Text
certificateBody = Text
pCertificateBody_,
$sel:status:SigningCertificate' :: StatusType
status = StatusType
pStatus_
}
signingCertificate_uploadDate :: Lens.Lens' SigningCertificate (Prelude.Maybe Prelude.UTCTime)
signingCertificate_uploadDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SigningCertificate -> f SigningCertificate
signingCertificate_uploadDate = (SigningCertificate -> Maybe ISO8601)
-> (SigningCertificate -> Maybe ISO8601 -> SigningCertificate)
-> Lens
SigningCertificate
SigningCertificate
(Maybe ISO8601)
(Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningCertificate' {Maybe ISO8601
uploadDate :: Maybe ISO8601
$sel:uploadDate:SigningCertificate' :: SigningCertificate -> Maybe ISO8601
uploadDate} -> Maybe ISO8601
uploadDate) (\s :: SigningCertificate
s@SigningCertificate' {} Maybe ISO8601
a -> SigningCertificate
s {$sel:uploadDate:SigningCertificate' :: Maybe ISO8601
uploadDate = Maybe ISO8601
a} :: SigningCertificate) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> SigningCertificate -> f SigningCertificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SigningCertificate
-> f SigningCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
signingCertificate_userName :: Lens.Lens' SigningCertificate Prelude.Text
signingCertificate_userName :: (Text -> f Text) -> SigningCertificate -> f SigningCertificate
signingCertificate_userName = (SigningCertificate -> Text)
-> (SigningCertificate -> Text -> SigningCertificate)
-> Lens SigningCertificate SigningCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningCertificate' {Text
userName :: Text
$sel:userName:SigningCertificate' :: SigningCertificate -> Text
userName} -> Text
userName) (\s :: SigningCertificate
s@SigningCertificate' {} Text
a -> SigningCertificate
s {$sel:userName:SigningCertificate' :: Text
userName = Text
a} :: SigningCertificate)
signingCertificate_certificateId :: Lens.Lens' SigningCertificate Prelude.Text
signingCertificate_certificateId :: (Text -> f Text) -> SigningCertificate -> f SigningCertificate
signingCertificate_certificateId = (SigningCertificate -> Text)
-> (SigningCertificate -> Text -> SigningCertificate)
-> Lens SigningCertificate SigningCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningCertificate' {Text
certificateId :: Text
$sel:certificateId:SigningCertificate' :: SigningCertificate -> Text
certificateId} -> Text
certificateId) (\s :: SigningCertificate
s@SigningCertificate' {} Text
a -> SigningCertificate
s {$sel:certificateId:SigningCertificate' :: Text
certificateId = Text
a} :: SigningCertificate)
signingCertificate_certificateBody :: Lens.Lens' SigningCertificate Prelude.Text
signingCertificate_certificateBody :: (Text -> f Text) -> SigningCertificate -> f SigningCertificate
signingCertificate_certificateBody = (SigningCertificate -> Text)
-> (SigningCertificate -> Text -> SigningCertificate)
-> Lens SigningCertificate SigningCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningCertificate' {Text
certificateBody :: Text
$sel:certificateBody:SigningCertificate' :: SigningCertificate -> Text
certificateBody} -> Text
certificateBody) (\s :: SigningCertificate
s@SigningCertificate' {} Text
a -> SigningCertificate
s {$sel:certificateBody:SigningCertificate' :: Text
certificateBody = Text
a} :: SigningCertificate)
signingCertificate_status :: Lens.Lens' SigningCertificate StatusType
signingCertificate_status :: (StatusType -> f StatusType)
-> SigningCertificate -> f SigningCertificate
signingCertificate_status = (SigningCertificate -> StatusType)
-> (SigningCertificate -> StatusType -> SigningCertificate)
-> Lens SigningCertificate SigningCertificate StatusType StatusType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningCertificate' {StatusType
status :: StatusType
$sel:status:SigningCertificate' :: SigningCertificate -> StatusType
status} -> StatusType
status) (\s :: SigningCertificate
s@SigningCertificate' {} StatusType
a -> SigningCertificate
s {$sel:status:SigningCertificate' :: StatusType
status = StatusType
a} :: SigningCertificate)
instance Core.FromXML SigningCertificate where
parseXML :: [Node] -> Either String SigningCertificate
parseXML [Node]
x =
Maybe ISO8601
-> Text -> Text -> Text -> StatusType -> SigningCertificate
SigningCertificate'
(Maybe ISO8601
-> Text -> Text -> Text -> StatusType -> SigningCertificate)
-> Either String (Maybe ISO8601)
-> Either
String (Text -> Text -> Text -> StatusType -> SigningCertificate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"UploadDate")
Either
String (Text -> Text -> Text -> StatusType -> SigningCertificate)
-> Either String Text
-> Either String (Text -> Text -> StatusType -> SigningCertificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"UserName")
Either String (Text -> Text -> StatusType -> SigningCertificate)
-> Either String Text
-> Either String (Text -> StatusType -> SigningCertificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CertificateId")
Either String (Text -> StatusType -> SigningCertificate)
-> Either String Text
-> Either String (StatusType -> SigningCertificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CertificateBody")
Either String (StatusType -> SigningCertificate)
-> Either String StatusType -> Either String SigningCertificate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String StatusType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")
instance Prelude.Hashable SigningCertificate
instance Prelude.NFData SigningCertificate