{-# 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.FieldLevelEncryption where
import Amazonka.CloudFront.Types.FieldLevelEncryptionConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FieldLevelEncryption = FieldLevelEncryption'
{
FieldLevelEncryption -> Text
id :: Prelude.Text,
FieldLevelEncryption -> ISO8601
lastModifiedTime :: Core.ISO8601,
FieldLevelEncryption -> FieldLevelEncryptionConfig
fieldLevelEncryptionConfig :: FieldLevelEncryptionConfig
}
deriving (FieldLevelEncryption -> FieldLevelEncryption -> Bool
(FieldLevelEncryption -> FieldLevelEncryption -> Bool)
-> (FieldLevelEncryption -> FieldLevelEncryption -> Bool)
-> Eq FieldLevelEncryption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FieldLevelEncryption -> FieldLevelEncryption -> Bool
$c/= :: FieldLevelEncryption -> FieldLevelEncryption -> Bool
== :: FieldLevelEncryption -> FieldLevelEncryption -> Bool
$c== :: FieldLevelEncryption -> FieldLevelEncryption -> Bool
Prelude.Eq, ReadPrec [FieldLevelEncryption]
ReadPrec FieldLevelEncryption
Int -> ReadS FieldLevelEncryption
ReadS [FieldLevelEncryption]
(Int -> ReadS FieldLevelEncryption)
-> ReadS [FieldLevelEncryption]
-> ReadPrec FieldLevelEncryption
-> ReadPrec [FieldLevelEncryption]
-> Read FieldLevelEncryption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FieldLevelEncryption]
$creadListPrec :: ReadPrec [FieldLevelEncryption]
readPrec :: ReadPrec FieldLevelEncryption
$creadPrec :: ReadPrec FieldLevelEncryption
readList :: ReadS [FieldLevelEncryption]
$creadList :: ReadS [FieldLevelEncryption]
readsPrec :: Int -> ReadS FieldLevelEncryption
$creadsPrec :: Int -> ReadS FieldLevelEncryption
Prelude.Read, Int -> FieldLevelEncryption -> ShowS
[FieldLevelEncryption] -> ShowS
FieldLevelEncryption -> String
(Int -> FieldLevelEncryption -> ShowS)
-> (FieldLevelEncryption -> String)
-> ([FieldLevelEncryption] -> ShowS)
-> Show FieldLevelEncryption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FieldLevelEncryption] -> ShowS
$cshowList :: [FieldLevelEncryption] -> ShowS
show :: FieldLevelEncryption -> String
$cshow :: FieldLevelEncryption -> String
showsPrec :: Int -> FieldLevelEncryption -> ShowS
$cshowsPrec :: Int -> FieldLevelEncryption -> ShowS
Prelude.Show, (forall x. FieldLevelEncryption -> Rep FieldLevelEncryption x)
-> (forall x. Rep FieldLevelEncryption x -> FieldLevelEncryption)
-> Generic FieldLevelEncryption
forall x. Rep FieldLevelEncryption x -> FieldLevelEncryption
forall x. FieldLevelEncryption -> Rep FieldLevelEncryption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FieldLevelEncryption x -> FieldLevelEncryption
$cfrom :: forall x. FieldLevelEncryption -> Rep FieldLevelEncryption x
Prelude.Generic)
newFieldLevelEncryption ::
Prelude.Text ->
Prelude.UTCTime ->
FieldLevelEncryptionConfig ->
FieldLevelEncryption
newFieldLevelEncryption :: Text
-> UTCTime -> FieldLevelEncryptionConfig -> FieldLevelEncryption
newFieldLevelEncryption
Text
pId_
UTCTime
pLastModifiedTime_
FieldLevelEncryptionConfig
pFieldLevelEncryptionConfig_ =
FieldLevelEncryption' :: Text
-> ISO8601 -> FieldLevelEncryptionConfig -> FieldLevelEncryption
FieldLevelEncryption'
{ $sel:id:FieldLevelEncryption' :: Text
id = Text
pId_,
$sel:lastModifiedTime:FieldLevelEncryption' :: ISO8601
lastModifiedTime =
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
pLastModifiedTime_,
$sel:fieldLevelEncryptionConfig:FieldLevelEncryption' :: FieldLevelEncryptionConfig
fieldLevelEncryptionConfig =
FieldLevelEncryptionConfig
pFieldLevelEncryptionConfig_
}
fieldLevelEncryption_id :: Lens.Lens' FieldLevelEncryption Prelude.Text
fieldLevelEncryption_id :: (Text -> f Text) -> FieldLevelEncryption -> f FieldLevelEncryption
fieldLevelEncryption_id = (FieldLevelEncryption -> Text)
-> (FieldLevelEncryption -> Text -> FieldLevelEncryption)
-> Lens FieldLevelEncryption FieldLevelEncryption Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryption' {Text
id :: Text
$sel:id:FieldLevelEncryption' :: FieldLevelEncryption -> Text
id} -> Text
id) (\s :: FieldLevelEncryption
s@FieldLevelEncryption' {} Text
a -> FieldLevelEncryption
s {$sel:id:FieldLevelEncryption' :: Text
id = Text
a} :: FieldLevelEncryption)
fieldLevelEncryption_lastModifiedTime :: Lens.Lens' FieldLevelEncryption Prelude.UTCTime
fieldLevelEncryption_lastModifiedTime :: (UTCTime -> f UTCTime)
-> FieldLevelEncryption -> f FieldLevelEncryption
fieldLevelEncryption_lastModifiedTime = (FieldLevelEncryption -> ISO8601)
-> (FieldLevelEncryption -> ISO8601 -> FieldLevelEncryption)
-> Lens FieldLevelEncryption FieldLevelEncryption ISO8601 ISO8601
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryption' {ISO8601
lastModifiedTime :: ISO8601
$sel:lastModifiedTime:FieldLevelEncryption' :: FieldLevelEncryption -> ISO8601
lastModifiedTime} -> ISO8601
lastModifiedTime) (\s :: FieldLevelEncryption
s@FieldLevelEncryption' {} ISO8601
a -> FieldLevelEncryption
s {$sel:lastModifiedTime:FieldLevelEncryption' :: ISO8601
lastModifiedTime = ISO8601
a} :: FieldLevelEncryption) ((ISO8601 -> f ISO8601)
-> FieldLevelEncryption -> f FieldLevelEncryption)
-> ((UTCTime -> f UTCTime) -> ISO8601 -> f ISO8601)
-> (UTCTime -> f UTCTime)
-> FieldLevelEncryption
-> f FieldLevelEncryption
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
fieldLevelEncryption_fieldLevelEncryptionConfig :: Lens.Lens' FieldLevelEncryption FieldLevelEncryptionConfig
fieldLevelEncryption_fieldLevelEncryptionConfig :: (FieldLevelEncryptionConfig -> f FieldLevelEncryptionConfig)
-> FieldLevelEncryption -> f FieldLevelEncryption
fieldLevelEncryption_fieldLevelEncryptionConfig = (FieldLevelEncryption -> FieldLevelEncryptionConfig)
-> (FieldLevelEncryption
-> FieldLevelEncryptionConfig -> FieldLevelEncryption)
-> Lens
FieldLevelEncryption
FieldLevelEncryption
FieldLevelEncryptionConfig
FieldLevelEncryptionConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FieldLevelEncryption' {FieldLevelEncryptionConfig
fieldLevelEncryptionConfig :: FieldLevelEncryptionConfig
$sel:fieldLevelEncryptionConfig:FieldLevelEncryption' :: FieldLevelEncryption -> FieldLevelEncryptionConfig
fieldLevelEncryptionConfig} -> FieldLevelEncryptionConfig
fieldLevelEncryptionConfig) (\s :: FieldLevelEncryption
s@FieldLevelEncryption' {} FieldLevelEncryptionConfig
a -> FieldLevelEncryption
s {$sel:fieldLevelEncryptionConfig:FieldLevelEncryption' :: FieldLevelEncryptionConfig
fieldLevelEncryptionConfig = FieldLevelEncryptionConfig
a} :: FieldLevelEncryption)
instance Core.FromXML FieldLevelEncryption where
parseXML :: [Node] -> Either String FieldLevelEncryption
parseXML [Node]
x =
Text
-> ISO8601 -> FieldLevelEncryptionConfig -> FieldLevelEncryption
FieldLevelEncryption'
(Text
-> ISO8601 -> FieldLevelEncryptionConfig -> FieldLevelEncryption)
-> Either String Text
-> Either
String
(ISO8601 -> FieldLevelEncryptionConfig -> FieldLevelEncryption)
forall (f :: * -> *) a b. Functor 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
(ISO8601 -> FieldLevelEncryptionConfig -> FieldLevelEncryption)
-> Either String ISO8601
-> Either
String (FieldLevelEncryptionConfig -> FieldLevelEncryption)
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
"LastModifiedTime")
Either String (FieldLevelEncryptionConfig -> FieldLevelEncryption)
-> Either String FieldLevelEncryptionConfig
-> Either String FieldLevelEncryption
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String FieldLevelEncryptionConfig
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"FieldLevelEncryptionConfig")
instance Prelude.Hashable FieldLevelEncryption
instance Prelude.NFData FieldLevelEncryption