{-# 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.APIGateway.Types.ClientCertificate where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClientCertificate = ClientCertificate'
{
ClientCertificate -> Maybe Text
pemEncodedCertificate :: Prelude.Maybe Prelude.Text,
ClientCertificate -> Maybe Text
clientCertificateId :: Prelude.Maybe Prelude.Text,
ClientCertificate -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
ClientCertificate -> Maybe POSIX
expirationDate :: Prelude.Maybe Core.POSIX,
ClientCertificate -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
ClientCertificate -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
}
deriving (ClientCertificate -> ClientCertificate -> Bool
(ClientCertificate -> ClientCertificate -> Bool)
-> (ClientCertificate -> ClientCertificate -> Bool)
-> Eq ClientCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientCertificate -> ClientCertificate -> Bool
$c/= :: ClientCertificate -> ClientCertificate -> Bool
== :: ClientCertificate -> ClientCertificate -> Bool
$c== :: ClientCertificate -> ClientCertificate -> Bool
Prelude.Eq, ReadPrec [ClientCertificate]
ReadPrec ClientCertificate
Int -> ReadS ClientCertificate
ReadS [ClientCertificate]
(Int -> ReadS ClientCertificate)
-> ReadS [ClientCertificate]
-> ReadPrec ClientCertificate
-> ReadPrec [ClientCertificate]
-> Read ClientCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClientCertificate]
$creadListPrec :: ReadPrec [ClientCertificate]
readPrec :: ReadPrec ClientCertificate
$creadPrec :: ReadPrec ClientCertificate
readList :: ReadS [ClientCertificate]
$creadList :: ReadS [ClientCertificate]
readsPrec :: Int -> ReadS ClientCertificate
$creadsPrec :: Int -> ReadS ClientCertificate
Prelude.Read, Int -> ClientCertificate -> ShowS
[ClientCertificate] -> ShowS
ClientCertificate -> String
(Int -> ClientCertificate -> ShowS)
-> (ClientCertificate -> String)
-> ([ClientCertificate] -> ShowS)
-> Show ClientCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClientCertificate] -> ShowS
$cshowList :: [ClientCertificate] -> ShowS
show :: ClientCertificate -> String
$cshow :: ClientCertificate -> String
showsPrec :: Int -> ClientCertificate -> ShowS
$cshowsPrec :: Int -> ClientCertificate -> ShowS
Prelude.Show, (forall x. ClientCertificate -> Rep ClientCertificate x)
-> (forall x. Rep ClientCertificate x -> ClientCertificate)
-> Generic ClientCertificate
forall x. Rep ClientCertificate x -> ClientCertificate
forall x. ClientCertificate -> Rep ClientCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClientCertificate x -> ClientCertificate
$cfrom :: forall x. ClientCertificate -> Rep ClientCertificate x
Prelude.Generic)
newClientCertificate ::
ClientCertificate
newClientCertificate :: ClientCertificate
newClientCertificate =
ClientCertificate' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ClientCertificate
ClientCertificate'
{ $sel:pemEncodedCertificate:ClientCertificate' :: Maybe Text
pemEncodedCertificate =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clientCertificateId:ClientCertificate' :: Maybe Text
clientCertificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdDate:ClientCertificate' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:expirationDate:ClientCertificate' :: Maybe POSIX
expirationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:description:ClientCertificate' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:ClientCertificate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
}
clientCertificate_pemEncodedCertificate :: Lens.Lens' ClientCertificate (Prelude.Maybe Prelude.Text)
clientCertificate_pemEncodedCertificate :: (Maybe Text -> f (Maybe Text))
-> ClientCertificate -> f ClientCertificate
clientCertificate_pemEncodedCertificate = (ClientCertificate -> Maybe Text)
-> (ClientCertificate -> Maybe Text -> ClientCertificate)
-> Lens
ClientCertificate ClientCertificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientCertificate' {Maybe Text
pemEncodedCertificate :: Maybe Text
$sel:pemEncodedCertificate:ClientCertificate' :: ClientCertificate -> Maybe Text
pemEncodedCertificate} -> Maybe Text
pemEncodedCertificate) (\s :: ClientCertificate
s@ClientCertificate' {} Maybe Text
a -> ClientCertificate
s {$sel:pemEncodedCertificate:ClientCertificate' :: Maybe Text
pemEncodedCertificate = Maybe Text
a} :: ClientCertificate)
clientCertificate_clientCertificateId :: Lens.Lens' ClientCertificate (Prelude.Maybe Prelude.Text)
clientCertificate_clientCertificateId :: (Maybe Text -> f (Maybe Text))
-> ClientCertificate -> f ClientCertificate
clientCertificate_clientCertificateId = (ClientCertificate -> Maybe Text)
-> (ClientCertificate -> Maybe Text -> ClientCertificate)
-> Lens
ClientCertificate ClientCertificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientCertificate' {Maybe Text
clientCertificateId :: Maybe Text
$sel:clientCertificateId:ClientCertificate' :: ClientCertificate -> Maybe Text
clientCertificateId} -> Maybe Text
clientCertificateId) (\s :: ClientCertificate
s@ClientCertificate' {} Maybe Text
a -> ClientCertificate
s {$sel:clientCertificateId:ClientCertificate' :: Maybe Text
clientCertificateId = Maybe Text
a} :: ClientCertificate)
clientCertificate_createdDate :: Lens.Lens' ClientCertificate (Prelude.Maybe Prelude.UTCTime)
clientCertificate_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ClientCertificate -> f ClientCertificate
clientCertificate_createdDate = (ClientCertificate -> Maybe POSIX)
-> (ClientCertificate -> Maybe POSIX -> ClientCertificate)
-> Lens
ClientCertificate ClientCertificate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientCertificate' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:ClientCertificate' :: ClientCertificate -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: ClientCertificate
s@ClientCertificate' {} Maybe POSIX
a -> ClientCertificate
s {$sel:createdDate:ClientCertificate' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: ClientCertificate) ((Maybe POSIX -> f (Maybe POSIX))
-> ClientCertificate -> f ClientCertificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ClientCertificate
-> f ClientCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
clientCertificate_expirationDate :: Lens.Lens' ClientCertificate (Prelude.Maybe Prelude.UTCTime)
clientCertificate_expirationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ClientCertificate -> f ClientCertificate
clientCertificate_expirationDate = (ClientCertificate -> Maybe POSIX)
-> (ClientCertificate -> Maybe POSIX -> ClientCertificate)
-> Lens
ClientCertificate ClientCertificate (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientCertificate' {Maybe POSIX
expirationDate :: Maybe POSIX
$sel:expirationDate:ClientCertificate' :: ClientCertificate -> Maybe POSIX
expirationDate} -> Maybe POSIX
expirationDate) (\s :: ClientCertificate
s@ClientCertificate' {} Maybe POSIX
a -> ClientCertificate
s {$sel:expirationDate:ClientCertificate' :: Maybe POSIX
expirationDate = Maybe POSIX
a} :: ClientCertificate) ((Maybe POSIX -> f (Maybe POSIX))
-> ClientCertificate -> f ClientCertificate)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ClientCertificate
-> f ClientCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
clientCertificate_description :: Lens.Lens' ClientCertificate (Prelude.Maybe Prelude.Text)
clientCertificate_description :: (Maybe Text -> f (Maybe Text))
-> ClientCertificate -> f ClientCertificate
clientCertificate_description = (ClientCertificate -> Maybe Text)
-> (ClientCertificate -> Maybe Text -> ClientCertificate)
-> Lens
ClientCertificate ClientCertificate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientCertificate' {Maybe Text
description :: Maybe Text
$sel:description:ClientCertificate' :: ClientCertificate -> Maybe Text
description} -> Maybe Text
description) (\s :: ClientCertificate
s@ClientCertificate' {} Maybe Text
a -> ClientCertificate
s {$sel:description:ClientCertificate' :: Maybe Text
description = Maybe Text
a} :: ClientCertificate)
clientCertificate_tags :: Lens.Lens' ClientCertificate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
clientCertificate_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ClientCertificate -> f ClientCertificate
clientCertificate_tags = (ClientCertificate -> Maybe (HashMap Text Text))
-> (ClientCertificate
-> Maybe (HashMap Text Text) -> ClientCertificate)
-> Lens
ClientCertificate
ClientCertificate
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientCertificate' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ClientCertificate' :: ClientCertificate -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ClientCertificate
s@ClientCertificate' {} Maybe (HashMap Text Text)
a -> ClientCertificate
s {$sel:tags:ClientCertificate' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ClientCertificate) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ClientCertificate -> f ClientCertificate)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ClientCertificate
-> f ClientCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ClientCertificate where
parseJSON :: Value -> Parser ClientCertificate
parseJSON =
String
-> (Object -> Parser ClientCertificate)
-> Value
-> Parser ClientCertificate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClientCertificate"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ClientCertificate
ClientCertificate'
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ClientCertificate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ClientCertificate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pemEncodedCertificate")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ClientCertificate)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ClientCertificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clientCertificateId")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> ClientCertificate)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe (HashMap Text Text) -> ClientCertificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdDate")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe (HashMap Text Text) -> ClientCertificate)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe (HashMap Text Text) -> ClientCertificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"expirationDate")
Parser
(Maybe Text -> Maybe (HashMap Text Text) -> ClientCertificate)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> ClientCertificate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
Parser (Maybe (HashMap Text Text) -> ClientCertificate)
-> Parser (Maybe (HashMap Text Text)) -> Parser ClientCertificate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ClientCertificate
instance Prelude.NFData ClientCertificate