{-# 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.ServerCertificateMetadata where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServerCertificateMetadata = ServerCertificateMetadata'
{
ServerCertificateMetadata -> Maybe ISO8601
uploadDate :: Prelude.Maybe Core.ISO8601,
ServerCertificateMetadata -> Maybe ISO8601
expiration :: Prelude.Maybe Core.ISO8601,
ServerCertificateMetadata -> Text
path :: Prelude.Text,
ServerCertificateMetadata -> Text
serverCertificateName :: Prelude.Text,
ServerCertificateMetadata -> Text
serverCertificateId :: Prelude.Text,
ServerCertificateMetadata -> Text
arn :: Prelude.Text
}
deriving (ServerCertificateMetadata -> ServerCertificateMetadata -> Bool
(ServerCertificateMetadata -> ServerCertificateMetadata -> Bool)
-> (ServerCertificateMetadata -> ServerCertificateMetadata -> Bool)
-> Eq ServerCertificateMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerCertificateMetadata -> ServerCertificateMetadata -> Bool
$c/= :: ServerCertificateMetadata -> ServerCertificateMetadata -> Bool
== :: ServerCertificateMetadata -> ServerCertificateMetadata -> Bool
$c== :: ServerCertificateMetadata -> ServerCertificateMetadata -> Bool
Prelude.Eq, ReadPrec [ServerCertificateMetadata]
ReadPrec ServerCertificateMetadata
Int -> ReadS ServerCertificateMetadata
ReadS [ServerCertificateMetadata]
(Int -> ReadS ServerCertificateMetadata)
-> ReadS [ServerCertificateMetadata]
-> ReadPrec ServerCertificateMetadata
-> ReadPrec [ServerCertificateMetadata]
-> Read ServerCertificateMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServerCertificateMetadata]
$creadListPrec :: ReadPrec [ServerCertificateMetadata]
readPrec :: ReadPrec ServerCertificateMetadata
$creadPrec :: ReadPrec ServerCertificateMetadata
readList :: ReadS [ServerCertificateMetadata]
$creadList :: ReadS [ServerCertificateMetadata]
readsPrec :: Int -> ReadS ServerCertificateMetadata
$creadsPrec :: Int -> ReadS ServerCertificateMetadata
Prelude.Read, Int -> ServerCertificateMetadata -> ShowS
[ServerCertificateMetadata] -> ShowS
ServerCertificateMetadata -> String
(Int -> ServerCertificateMetadata -> ShowS)
-> (ServerCertificateMetadata -> String)
-> ([ServerCertificateMetadata] -> ShowS)
-> Show ServerCertificateMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServerCertificateMetadata] -> ShowS
$cshowList :: [ServerCertificateMetadata] -> ShowS
show :: ServerCertificateMetadata -> String
$cshow :: ServerCertificateMetadata -> String
showsPrec :: Int -> ServerCertificateMetadata -> ShowS
$cshowsPrec :: Int -> ServerCertificateMetadata -> ShowS
Prelude.Show, (forall x.
ServerCertificateMetadata -> Rep ServerCertificateMetadata x)
-> (forall x.
Rep ServerCertificateMetadata x -> ServerCertificateMetadata)
-> Generic ServerCertificateMetadata
forall x.
Rep ServerCertificateMetadata x -> ServerCertificateMetadata
forall x.
ServerCertificateMetadata -> Rep ServerCertificateMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ServerCertificateMetadata x -> ServerCertificateMetadata
$cfrom :: forall x.
ServerCertificateMetadata -> Rep ServerCertificateMetadata x
Prelude.Generic)
newServerCertificateMetadata ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ServerCertificateMetadata
newServerCertificateMetadata :: Text -> Text -> Text -> Text -> ServerCertificateMetadata
newServerCertificateMetadata
Text
pPath_
Text
pServerCertificateName_
Text
pServerCertificateId_
Text
pArn_ =
ServerCertificateMetadata' :: Maybe ISO8601
-> Maybe ISO8601
-> Text
-> Text
-> Text
-> Text
-> ServerCertificateMetadata
ServerCertificateMetadata'
{ $sel:uploadDate:ServerCertificateMetadata' :: Maybe ISO8601
uploadDate =
Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:expiration:ServerCertificateMetadata' :: Maybe ISO8601
expiration = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:path:ServerCertificateMetadata' :: Text
path = Text
pPath_,
$sel:serverCertificateName:ServerCertificateMetadata' :: Text
serverCertificateName = Text
pServerCertificateName_,
$sel:serverCertificateId:ServerCertificateMetadata' :: Text
serverCertificateId = Text
pServerCertificateId_,
$sel:arn:ServerCertificateMetadata' :: Text
arn = Text
pArn_
}
serverCertificateMetadata_uploadDate :: Lens.Lens' ServerCertificateMetadata (Prelude.Maybe Prelude.UTCTime)
serverCertificateMetadata_uploadDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServerCertificateMetadata -> f ServerCertificateMetadata
serverCertificateMetadata_uploadDate = (ServerCertificateMetadata -> Maybe ISO8601)
-> (ServerCertificateMetadata
-> Maybe ISO8601 -> ServerCertificateMetadata)
-> Lens
ServerCertificateMetadata
ServerCertificateMetadata
(Maybe ISO8601)
(Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerCertificateMetadata' {Maybe ISO8601
uploadDate :: Maybe ISO8601
$sel:uploadDate:ServerCertificateMetadata' :: ServerCertificateMetadata -> Maybe ISO8601
uploadDate} -> Maybe ISO8601
uploadDate) (\s :: ServerCertificateMetadata
s@ServerCertificateMetadata' {} Maybe ISO8601
a -> ServerCertificateMetadata
s {$sel:uploadDate:ServerCertificateMetadata' :: Maybe ISO8601
uploadDate = Maybe ISO8601
a} :: ServerCertificateMetadata) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> ServerCertificateMetadata -> f ServerCertificateMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServerCertificateMetadata
-> f ServerCertificateMetadata
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
serverCertificateMetadata_expiration :: Lens.Lens' ServerCertificateMetadata (Prelude.Maybe Prelude.UTCTime)
serverCertificateMetadata_expiration :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServerCertificateMetadata -> f ServerCertificateMetadata
serverCertificateMetadata_expiration = (ServerCertificateMetadata -> Maybe ISO8601)
-> (ServerCertificateMetadata
-> Maybe ISO8601 -> ServerCertificateMetadata)
-> Lens
ServerCertificateMetadata
ServerCertificateMetadata
(Maybe ISO8601)
(Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerCertificateMetadata' {Maybe ISO8601
expiration :: Maybe ISO8601
$sel:expiration:ServerCertificateMetadata' :: ServerCertificateMetadata -> Maybe ISO8601
expiration} -> Maybe ISO8601
expiration) (\s :: ServerCertificateMetadata
s@ServerCertificateMetadata' {} Maybe ISO8601
a -> ServerCertificateMetadata
s {$sel:expiration:ServerCertificateMetadata' :: Maybe ISO8601
expiration = Maybe ISO8601
a} :: ServerCertificateMetadata) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> ServerCertificateMetadata -> f ServerCertificateMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServerCertificateMetadata
-> f ServerCertificateMetadata
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
serverCertificateMetadata_path :: Lens.Lens' ServerCertificateMetadata Prelude.Text
serverCertificateMetadata_path :: (Text -> f Text)
-> ServerCertificateMetadata -> f ServerCertificateMetadata
serverCertificateMetadata_path = (ServerCertificateMetadata -> Text)
-> (ServerCertificateMetadata -> Text -> ServerCertificateMetadata)
-> Lens
ServerCertificateMetadata ServerCertificateMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerCertificateMetadata' {Text
path :: Text
$sel:path:ServerCertificateMetadata' :: ServerCertificateMetadata -> Text
path} -> Text
path) (\s :: ServerCertificateMetadata
s@ServerCertificateMetadata' {} Text
a -> ServerCertificateMetadata
s {$sel:path:ServerCertificateMetadata' :: Text
path = Text
a} :: ServerCertificateMetadata)
serverCertificateMetadata_serverCertificateName :: Lens.Lens' ServerCertificateMetadata Prelude.Text
serverCertificateMetadata_serverCertificateName :: (Text -> f Text)
-> ServerCertificateMetadata -> f ServerCertificateMetadata
serverCertificateMetadata_serverCertificateName = (ServerCertificateMetadata -> Text)
-> (ServerCertificateMetadata -> Text -> ServerCertificateMetadata)
-> Lens
ServerCertificateMetadata ServerCertificateMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerCertificateMetadata' {Text
serverCertificateName :: Text
$sel:serverCertificateName:ServerCertificateMetadata' :: ServerCertificateMetadata -> Text
serverCertificateName} -> Text
serverCertificateName) (\s :: ServerCertificateMetadata
s@ServerCertificateMetadata' {} Text
a -> ServerCertificateMetadata
s {$sel:serverCertificateName:ServerCertificateMetadata' :: Text
serverCertificateName = Text
a} :: ServerCertificateMetadata)
serverCertificateMetadata_serverCertificateId :: Lens.Lens' ServerCertificateMetadata Prelude.Text
serverCertificateMetadata_serverCertificateId :: (Text -> f Text)
-> ServerCertificateMetadata -> f ServerCertificateMetadata
serverCertificateMetadata_serverCertificateId = (ServerCertificateMetadata -> Text)
-> (ServerCertificateMetadata -> Text -> ServerCertificateMetadata)
-> Lens
ServerCertificateMetadata ServerCertificateMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerCertificateMetadata' {Text
serverCertificateId :: Text
$sel:serverCertificateId:ServerCertificateMetadata' :: ServerCertificateMetadata -> Text
serverCertificateId} -> Text
serverCertificateId) (\s :: ServerCertificateMetadata
s@ServerCertificateMetadata' {} Text
a -> ServerCertificateMetadata
s {$sel:serverCertificateId:ServerCertificateMetadata' :: Text
serverCertificateId = Text
a} :: ServerCertificateMetadata)
serverCertificateMetadata_arn :: Lens.Lens' ServerCertificateMetadata Prelude.Text
serverCertificateMetadata_arn :: (Text -> f Text)
-> ServerCertificateMetadata -> f ServerCertificateMetadata
serverCertificateMetadata_arn = (ServerCertificateMetadata -> Text)
-> (ServerCertificateMetadata -> Text -> ServerCertificateMetadata)
-> Lens
ServerCertificateMetadata ServerCertificateMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerCertificateMetadata' {Text
arn :: Text
$sel:arn:ServerCertificateMetadata' :: ServerCertificateMetadata -> Text
arn} -> Text
arn) (\s :: ServerCertificateMetadata
s@ServerCertificateMetadata' {} Text
a -> ServerCertificateMetadata
s {$sel:arn:ServerCertificateMetadata' :: Text
arn = Text
a} :: ServerCertificateMetadata)
instance Core.FromXML ServerCertificateMetadata where
parseXML :: [Node] -> Either String ServerCertificateMetadata
parseXML [Node]
x =
Maybe ISO8601
-> Maybe ISO8601
-> Text
-> Text
-> Text
-> Text
-> ServerCertificateMetadata
ServerCertificateMetadata'
(Maybe ISO8601
-> Maybe ISO8601
-> Text
-> Text
-> Text
-> Text
-> ServerCertificateMetadata)
-> Either String (Maybe ISO8601)
-> Either
String
(Maybe ISO8601
-> Text -> Text -> Text -> Text -> ServerCertificateMetadata)
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
(Maybe ISO8601
-> Text -> Text -> Text -> Text -> ServerCertificateMetadata)
-> Either String (Maybe ISO8601)
-> Either
String (Text -> Text -> Text -> Text -> ServerCertificateMetadata)
forall (f :: * -> *) a b. Applicative f => 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
"Expiration")
Either
String (Text -> Text -> Text -> Text -> ServerCertificateMetadata)
-> Either String Text
-> Either
String (Text -> Text -> Text -> ServerCertificateMetadata)
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
"Path")
Either String (Text -> Text -> Text -> ServerCertificateMetadata)
-> Either String Text
-> Either String (Text -> Text -> ServerCertificateMetadata)
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
"ServerCertificateName")
Either String (Text -> Text -> ServerCertificateMetadata)
-> Either String Text
-> Either String (Text -> ServerCertificateMetadata)
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
"ServerCertificateId")
Either String (Text -> ServerCertificateMetadata)
-> Either String Text -> Either String ServerCertificateMetadata
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
"Arn")
instance Prelude.Hashable ServerCertificateMetadata
instance Prelude.NFData ServerCertificateMetadata