{-# 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.CloudFront.Types.PublicKeySummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PublicKeySummary = PublicKeySummary'
{
:: Prelude.Maybe Prelude.Text,
PublicKeySummary -> Text
id :: Prelude.Text,
PublicKeySummary -> Text
name :: Prelude.Text,
PublicKeySummary -> ISO8601
createdTime :: Core.ISO8601,
PublicKeySummary -> Text
encodedKey :: Prelude.Text
}
deriving (PublicKeySummary -> PublicKeySummary -> Bool
(PublicKeySummary -> PublicKeySummary -> Bool)
-> (PublicKeySummary -> PublicKeySummary -> Bool)
-> Eq PublicKeySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublicKeySummary -> PublicKeySummary -> Bool
$c/= :: PublicKeySummary -> PublicKeySummary -> Bool
== :: PublicKeySummary -> PublicKeySummary -> Bool
$c== :: PublicKeySummary -> PublicKeySummary -> Bool
Prelude.Eq, ReadPrec [PublicKeySummary]
ReadPrec PublicKeySummary
Int -> ReadS PublicKeySummary
ReadS [PublicKeySummary]
(Int -> ReadS PublicKeySummary)
-> ReadS [PublicKeySummary]
-> ReadPrec PublicKeySummary
-> ReadPrec [PublicKeySummary]
-> Read PublicKeySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublicKeySummary]
$creadListPrec :: ReadPrec [PublicKeySummary]
readPrec :: ReadPrec PublicKeySummary
$creadPrec :: ReadPrec PublicKeySummary
readList :: ReadS [PublicKeySummary]
$creadList :: ReadS [PublicKeySummary]
readsPrec :: Int -> ReadS PublicKeySummary
$creadsPrec :: Int -> ReadS PublicKeySummary
Prelude.Read, Int -> PublicKeySummary -> ShowS
[PublicKeySummary] -> ShowS
PublicKeySummary -> String
(Int -> PublicKeySummary -> ShowS)
-> (PublicKeySummary -> String)
-> ([PublicKeySummary] -> ShowS)
-> Show PublicKeySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublicKeySummary] -> ShowS
$cshowList :: [PublicKeySummary] -> ShowS
show :: PublicKeySummary -> String
$cshow :: PublicKeySummary -> String
showsPrec :: Int -> PublicKeySummary -> ShowS
$cshowsPrec :: Int -> PublicKeySummary -> ShowS
Prelude.Show, (forall x. PublicKeySummary -> Rep PublicKeySummary x)
-> (forall x. Rep PublicKeySummary x -> PublicKeySummary)
-> Generic PublicKeySummary
forall x. Rep PublicKeySummary x -> PublicKeySummary
forall x. PublicKeySummary -> Rep PublicKeySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PublicKeySummary x -> PublicKeySummary
$cfrom :: forall x. PublicKeySummary -> Rep PublicKeySummary x
Prelude.Generic)
newPublicKeySummary ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.Text ->
PublicKeySummary
newPublicKeySummary :: Text -> Text -> UTCTime -> Text -> PublicKeySummary
newPublicKeySummary
Text
pId_
Text
pName_
UTCTime
pCreatedTime_
Text
pEncodedKey_ =
PublicKeySummary' :: Maybe Text -> Text -> Text -> ISO8601 -> Text -> PublicKeySummary
PublicKeySummary'
{ $sel:comment:PublicKeySummary' :: Maybe Text
comment = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:PublicKeySummary' :: Text
id = Text
pId_,
$sel:name:PublicKeySummary' :: Text
name = Text
pName_,
$sel:createdTime:PublicKeySummary' :: ISO8601
createdTime = Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged ISO8601 (Identity ISO8601))
-> UTCTime -> ISO8601
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedTime_,
$sel:encodedKey:PublicKeySummary' :: Text
encodedKey = Text
pEncodedKey_
}
publicKeySummary_comment :: Lens.Lens' PublicKeySummary (Prelude.Maybe Prelude.Text)
= (PublicKeySummary -> Maybe Text)
-> (PublicKeySummary -> Maybe Text -> PublicKeySummary)
-> Lens PublicKeySummary PublicKeySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicKeySummary' {Maybe Text
comment :: Maybe Text
$sel:comment:PublicKeySummary' :: PublicKeySummary -> Maybe Text
comment} -> Maybe Text
comment) (\s :: PublicKeySummary
s@PublicKeySummary' {} Maybe Text
a -> PublicKeySummary
s {$sel:comment:PublicKeySummary' :: Maybe Text
comment = Maybe Text
a} :: PublicKeySummary)
publicKeySummary_id :: Lens.Lens' PublicKeySummary Prelude.Text
publicKeySummary_id :: (Text -> f Text) -> PublicKeySummary -> f PublicKeySummary
publicKeySummary_id = (PublicKeySummary -> Text)
-> (PublicKeySummary -> Text -> PublicKeySummary)
-> Lens PublicKeySummary PublicKeySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicKeySummary' {Text
id :: Text
$sel:id:PublicKeySummary' :: PublicKeySummary -> Text
id} -> Text
id) (\s :: PublicKeySummary
s@PublicKeySummary' {} Text
a -> PublicKeySummary
s {$sel:id:PublicKeySummary' :: Text
id = Text
a} :: PublicKeySummary)
publicKeySummary_name :: Lens.Lens' PublicKeySummary Prelude.Text
publicKeySummary_name :: (Text -> f Text) -> PublicKeySummary -> f PublicKeySummary
publicKeySummary_name = (PublicKeySummary -> Text)
-> (PublicKeySummary -> Text -> PublicKeySummary)
-> Lens PublicKeySummary PublicKeySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicKeySummary' {Text
name :: Text
$sel:name:PublicKeySummary' :: PublicKeySummary -> Text
name} -> Text
name) (\s :: PublicKeySummary
s@PublicKeySummary' {} Text
a -> PublicKeySummary
s {$sel:name:PublicKeySummary' :: Text
name = Text
a} :: PublicKeySummary)
publicKeySummary_createdTime :: Lens.Lens' PublicKeySummary Prelude.UTCTime
publicKeySummary_createdTime :: (UTCTime -> f UTCTime) -> PublicKeySummary -> f PublicKeySummary
publicKeySummary_createdTime = (PublicKeySummary -> ISO8601)
-> (PublicKeySummary -> ISO8601 -> PublicKeySummary)
-> Lens PublicKeySummary PublicKeySummary ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicKeySummary' {ISO8601
createdTime :: ISO8601
$sel:createdTime:PublicKeySummary' :: PublicKeySummary -> ISO8601
createdTime} -> ISO8601
createdTime) (\s :: PublicKeySummary
s@PublicKeySummary' {} ISO8601
a -> PublicKeySummary
s {$sel:createdTime:PublicKeySummary' :: ISO8601
createdTime = ISO8601
a} :: PublicKeySummary) ((ISO8601 -> f ISO8601) -> PublicKeySummary -> f PublicKeySummary)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> PublicKeySummary
-> f PublicKeySummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
publicKeySummary_encodedKey :: Lens.Lens' PublicKeySummary Prelude.Text
publicKeySummary_encodedKey :: (Text -> f Text) -> PublicKeySummary -> f PublicKeySummary
publicKeySummary_encodedKey = (PublicKeySummary -> Text)
-> (PublicKeySummary -> Text -> PublicKeySummary)
-> Lens PublicKeySummary PublicKeySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicKeySummary' {Text
encodedKey :: Text
$sel:encodedKey:PublicKeySummary' :: PublicKeySummary -> Text
encodedKey} -> Text
encodedKey) (\s :: PublicKeySummary
s@PublicKeySummary' {} Text
a -> PublicKeySummary
s {$sel:encodedKey:PublicKeySummary' :: Text
encodedKey = Text
a} :: PublicKeySummary)
instance Core.FromXML PublicKeySummary where
parseXML :: [Node] -> Either String PublicKeySummary
parseXML [Node]
x =
Maybe Text -> Text -> Text -> ISO8601 -> Text -> PublicKeySummary
PublicKeySummary'
(Maybe Text -> Text -> Text -> ISO8601 -> Text -> PublicKeySummary)
-> Either String (Maybe Text)
-> Either
String (Text -> Text -> ISO8601 -> Text -> PublicKeySummary)
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
"Comment")
Either String (Text -> Text -> ISO8601 -> Text -> PublicKeySummary)
-> Either String Text
-> Either String (Text -> ISO8601 -> Text -> PublicKeySummary)
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
"Id")
Either String (Text -> ISO8601 -> Text -> PublicKeySummary)
-> Either String Text
-> Either String (ISO8601 -> Text -> PublicKeySummary)
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
"Name")
Either String (ISO8601 -> Text -> PublicKeySummary)
-> Either String ISO8601
-> Either String (Text -> PublicKeySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String ISO8601
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"CreatedTime")
Either String (Text -> PublicKeySummary)
-> Either String Text -> Either String PublicKeySummary
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
"EncodedKey")
instance Prelude.Hashable PublicKeySummary
instance Prelude.NFData PublicKeySummary