{-# 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.DocumentDB.Types.Certificate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Certificate = Certificate'
{
Certificate -> Maybe Text
certificateType :: Prelude.Maybe Prelude.Text,
Certificate -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
Certificate -> Maybe ISO8601
validTill :: Prelude.Maybe Core.ISO8601,
Certificate -> Maybe Text
certificateIdentifier :: Prelude.Maybe Prelude.Text,
Certificate -> Maybe Text
thumbprint :: Prelude.Maybe Prelude.Text,
Certificate -> Maybe ISO8601
validFrom :: Prelude.Maybe Core.ISO8601
}
deriving (Certificate -> Certificate -> Bool
(Certificate -> Certificate -> Bool)
-> (Certificate -> Certificate -> Bool) -> Eq Certificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Certificate -> Certificate -> Bool
$c/= :: Certificate -> Certificate -> Bool
== :: Certificate -> Certificate -> Bool
$c== :: Certificate -> Certificate -> Bool
Prelude.Eq, ReadPrec [Certificate]
ReadPrec Certificate
Int -> ReadS Certificate
ReadS [Certificate]
(Int -> ReadS Certificate)
-> ReadS [Certificate]
-> ReadPrec Certificate
-> ReadPrec [Certificate]
-> Read Certificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Certificate]
$creadListPrec :: ReadPrec [Certificate]
readPrec :: ReadPrec Certificate
$creadPrec :: ReadPrec Certificate
readList :: ReadS [Certificate]
$creadList :: ReadS [Certificate]
readsPrec :: Int -> ReadS Certificate
$creadsPrec :: Int -> ReadS Certificate
Prelude.Read, Int -> Certificate -> ShowS
[Certificate] -> ShowS
Certificate -> String
(Int -> Certificate -> ShowS)
-> (Certificate -> String)
-> ([Certificate] -> ShowS)
-> Show Certificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Certificate] -> ShowS
$cshowList :: [Certificate] -> ShowS
show :: Certificate -> String
$cshow :: Certificate -> String
showsPrec :: Int -> Certificate -> ShowS
$cshowsPrec :: Int -> Certificate -> ShowS
Prelude.Show, (forall x. Certificate -> Rep Certificate x)
-> (forall x. Rep Certificate x -> Certificate)
-> Generic Certificate
forall x. Rep Certificate x -> Certificate
forall x. Certificate -> Rep Certificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Certificate x -> Certificate
$cfrom :: forall x. Certificate -> Rep Certificate x
Prelude.Generic)
newCertificate ::
Certificate
newCertificate :: Certificate
newCertificate =
Certificate' :: Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Certificate
Certificate'
{ $sel:certificateType:Certificate' :: Maybe Text
certificateType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificateArn:Certificate' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:validTill:Certificate' :: Maybe ISO8601
validTill = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:certificateIdentifier:Certificate' :: Maybe Text
certificateIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thumbprint:Certificate' :: Maybe Text
thumbprint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:validFrom:Certificate' :: Maybe ISO8601
validFrom = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing
}
certificate_certificateType :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_certificateType :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_certificateType = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
certificateType :: Maybe Text
$sel:certificateType:Certificate' :: Certificate -> Maybe Text
certificateType} -> Maybe Text
certificateType) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:certificateType:Certificate' :: Maybe Text
certificateType = Maybe Text
a} :: Certificate)
certificate_certificateArn :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_certificateArn :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_certificateArn = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:Certificate' :: Certificate -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:certificateArn:Certificate' :: Maybe Text
certificateArn = Maybe Text
a} :: Certificate)
certificate_validTill :: Lens.Lens' Certificate (Prelude.Maybe Prelude.UTCTime)
certificate_validTill :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate -> f Certificate
certificate_validTill = (Certificate -> Maybe ISO8601)
-> (Certificate -> Maybe ISO8601 -> Certificate)
-> Lens Certificate Certificate (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe ISO8601
validTill :: Maybe ISO8601
$sel:validTill:Certificate' :: Certificate -> Maybe ISO8601
validTill} -> Maybe ISO8601
validTill) (\s :: Certificate
s@Certificate' {} Maybe ISO8601
a -> Certificate
s {$sel:validTill:Certificate' :: Maybe ISO8601
validTill = Maybe ISO8601
a} :: Certificate) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> Certificate -> f Certificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate
-> f Certificate
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
certificate_certificateIdentifier :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_certificateIdentifier :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_certificateIdentifier = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
certificateIdentifier :: Maybe Text
$sel:certificateIdentifier:Certificate' :: Certificate -> Maybe Text
certificateIdentifier} -> Maybe Text
certificateIdentifier) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:certificateIdentifier:Certificate' :: Maybe Text
certificateIdentifier = Maybe Text
a} :: Certificate)
certificate_thumbprint :: Lens.Lens' Certificate (Prelude.Maybe Prelude.Text)
certificate_thumbprint :: (Maybe Text -> f (Maybe Text)) -> Certificate -> f Certificate
certificate_thumbprint = (Certificate -> Maybe Text)
-> (Certificate -> Maybe Text -> Certificate)
-> Lens Certificate Certificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe Text
thumbprint :: Maybe Text
$sel:thumbprint:Certificate' :: Certificate -> Maybe Text
thumbprint} -> Maybe Text
thumbprint) (\s :: Certificate
s@Certificate' {} Maybe Text
a -> Certificate
s {$sel:thumbprint:Certificate' :: Maybe Text
thumbprint = Maybe Text
a} :: Certificate)
certificate_validFrom :: Lens.Lens' Certificate (Prelude.Maybe Prelude.UTCTime)
certificate_validFrom :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate -> f Certificate
certificate_validFrom = (Certificate -> Maybe ISO8601)
-> (Certificate -> Maybe ISO8601 -> Certificate)
-> Lens Certificate Certificate (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Certificate' {Maybe ISO8601
validFrom :: Maybe ISO8601
$sel:validFrom:Certificate' :: Certificate -> Maybe ISO8601
validFrom} -> Maybe ISO8601
validFrom) (\s :: Certificate
s@Certificate' {} Maybe ISO8601
a -> Certificate
s {$sel:validFrom:Certificate' :: Maybe ISO8601
validFrom = Maybe ISO8601
a} :: Certificate) ((Maybe ISO8601 -> f (Maybe ISO8601))
-> Certificate -> f Certificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Certificate
-> f Certificate
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
instance Core.FromXML Certificate where
parseXML :: [Node] -> Either String Certificate
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Certificate
Certificate'
(Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Certificate)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Certificate)
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
"CertificateType")
Either
String
(Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Certificate)
-> Either String (Maybe Text)
-> Either
String
(Maybe ISO8601
-> Maybe Text -> Maybe Text -> Maybe ISO8601 -> Certificate)
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
"CertificateArn")
Either
String
(Maybe ISO8601
-> Maybe Text -> Maybe Text -> Maybe ISO8601 -> Certificate)
-> Either String (Maybe ISO8601)
-> Either
String (Maybe Text -> Maybe Text -> Maybe ISO8601 -> Certificate)
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
"ValidTill")
Either
String (Maybe Text -> Maybe Text -> Maybe ISO8601 -> Certificate)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe ISO8601 -> Certificate)
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
"CertificateIdentifier")
Either String (Maybe Text -> Maybe ISO8601 -> Certificate)
-> Either String (Maybe Text)
-> Either String (Maybe ISO8601 -> Certificate)
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
"Thumbprint")
Either String (Maybe ISO8601 -> Certificate)
-> Either String (Maybe ISO8601) -> Either String Certificate
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
"ValidFrom")
instance Prelude.Hashable Certificate
instance Prelude.NFData Certificate