{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types.StatusType
import qualified Amazonka.Prelude as Prelude
data SigningCertificate = SigningCertificate'
{
SigningCertificate -> Maybe ISO8601
uploadDate :: Prelude.Maybe Data.ISO8601,
SigningCertificate -> Text
userName :: Prelude.Text,
SigningCertificate -> Text
certificateId :: Prelude.Text,
SigningCertificate -> Text
certificateBody :: Prelude.Text,
SigningCertificate -> StatusType
status :: StatusType
}
deriving (SigningCertificate -> SigningCertificate -> Bool
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]
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
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. 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'
{ $sel:uploadDate:SigningCertificate' :: Maybe ISO8601
uploadDate = 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 :: Lens' SigningCertificate (Maybe UTCTime)
signingCertificate_uploadDate = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
signingCertificate_userName :: Lens.Lens' SigningCertificate Prelude.Text
signingCertificate_userName :: Lens' SigningCertificate Text
signingCertificate_userName = 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 :: Lens' SigningCertificate Text
signingCertificate_certificateId = 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 :: Lens' SigningCertificate Text
signingCertificate_certificateBody = 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 :: Lens' SigningCertificate StatusType
signingCertificate_status = 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 Data.FromXML SigningCertificate where
parseXML :: [Node] -> Either String SigningCertificate
parseXML [Node]
x =
Maybe ISO8601
-> Text -> Text -> Text -> StatusType -> SigningCertificate
SigningCertificate'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"UploadDate")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"UserName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"CertificateId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"CertificateBody")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Status")
instance Prelude.Hashable SigningCertificate where
hashWithSalt :: Int -> SigningCertificate -> Int
hashWithSalt Int
_salt SigningCertificate' {Maybe ISO8601
Text
StatusType
status :: StatusType
certificateBody :: Text
certificateId :: Text
userName :: Text
uploadDate :: Maybe ISO8601
$sel:status:SigningCertificate' :: SigningCertificate -> StatusType
$sel:certificateBody:SigningCertificate' :: SigningCertificate -> Text
$sel:certificateId:SigningCertificate' :: SigningCertificate -> Text
$sel:userName:SigningCertificate' :: SigningCertificate -> Text
$sel:uploadDate:SigningCertificate' :: SigningCertificate -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
uploadDate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateBody
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StatusType
status
instance Prelude.NFData SigningCertificate where
rnf :: SigningCertificate -> ()
rnf SigningCertificate' {Maybe ISO8601
Text
StatusType
status :: StatusType
certificateBody :: Text
certificateId :: Text
userName :: Text
uploadDate :: Maybe ISO8601
$sel:status:SigningCertificate' :: SigningCertificate -> StatusType
$sel:certificateBody:SigningCertificate' :: SigningCertificate -> Text
$sel:certificateId:SigningCertificate' :: SigningCertificate -> Text
$sel:userName:SigningCertificate' :: SigningCertificate -> Text
$sel:uploadDate:SigningCertificate' :: SigningCertificate -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
uploadDate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
certificateId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
certificateBody
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StatusType
status