{-# 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.KeyGroup where
import Amazonka.CloudFront.Types.KeyGroupConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data KeyGroup = KeyGroup'
{
KeyGroup -> Text
id :: Prelude.Text,
KeyGroup -> ISO8601
lastModifiedTime :: Data.ISO8601,
KeyGroup -> KeyGroupConfig
keyGroupConfig :: KeyGroupConfig
}
deriving (KeyGroup -> KeyGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeyGroup -> KeyGroup -> Bool
$c/= :: KeyGroup -> KeyGroup -> Bool
== :: KeyGroup -> KeyGroup -> Bool
$c== :: KeyGroup -> KeyGroup -> Bool
Prelude.Eq, ReadPrec [KeyGroup]
ReadPrec KeyGroup
Int -> ReadS KeyGroup
ReadS [KeyGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KeyGroup]
$creadListPrec :: ReadPrec [KeyGroup]
readPrec :: ReadPrec KeyGroup
$creadPrec :: ReadPrec KeyGroup
readList :: ReadS [KeyGroup]
$creadList :: ReadS [KeyGroup]
readsPrec :: Int -> ReadS KeyGroup
$creadsPrec :: Int -> ReadS KeyGroup
Prelude.Read, Int -> KeyGroup -> ShowS
[KeyGroup] -> ShowS
KeyGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyGroup] -> ShowS
$cshowList :: [KeyGroup] -> ShowS
show :: KeyGroup -> String
$cshow :: KeyGroup -> String
showsPrec :: Int -> KeyGroup -> ShowS
$cshowsPrec :: Int -> KeyGroup -> ShowS
Prelude.Show, forall x. Rep KeyGroup x -> KeyGroup
forall x. KeyGroup -> Rep KeyGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyGroup x -> KeyGroup
$cfrom :: forall x. KeyGroup -> Rep KeyGroup x
Prelude.Generic)
newKeyGroup ::
Prelude.Text ->
Prelude.UTCTime ->
KeyGroupConfig ->
KeyGroup
newKeyGroup :: Text -> UTCTime -> KeyGroupConfig -> KeyGroup
newKeyGroup Text
pId_ UTCTime
pLastModifiedTime_ KeyGroupConfig
pKeyGroupConfig_ =
KeyGroup'
{ $sel:id:KeyGroup' :: Text
id = Text
pId_,
$sel:lastModifiedTime:KeyGroup' :: ISO8601
lastModifiedTime =
forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedTime_,
$sel:keyGroupConfig:KeyGroup' :: KeyGroupConfig
keyGroupConfig = KeyGroupConfig
pKeyGroupConfig_
}
keyGroup_id :: Lens.Lens' KeyGroup Prelude.Text
keyGroup_id :: Lens' KeyGroup Text
keyGroup_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroup' {Text
id :: Text
$sel:id:KeyGroup' :: KeyGroup -> Text
id} -> Text
id) (\s :: KeyGroup
s@KeyGroup' {} Text
a -> KeyGroup
s {$sel:id:KeyGroup' :: Text
id = Text
a} :: KeyGroup)
keyGroup_lastModifiedTime :: Lens.Lens' KeyGroup Prelude.UTCTime
keyGroup_lastModifiedTime :: Lens' KeyGroup UTCTime
keyGroup_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroup' {ISO8601
lastModifiedTime :: ISO8601
$sel:lastModifiedTime:KeyGroup' :: KeyGroup -> ISO8601
lastModifiedTime} -> ISO8601
lastModifiedTime) (\s :: KeyGroup
s@KeyGroup' {} ISO8601
a -> KeyGroup
s {$sel:lastModifiedTime:KeyGroup' :: ISO8601
lastModifiedTime = ISO8601
a} :: KeyGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
keyGroup_keyGroupConfig :: Lens.Lens' KeyGroup KeyGroupConfig
keyGroup_keyGroupConfig :: Lens' KeyGroup KeyGroupConfig
keyGroup_keyGroupConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroup' {KeyGroupConfig
keyGroupConfig :: KeyGroupConfig
$sel:keyGroupConfig:KeyGroup' :: KeyGroup -> KeyGroupConfig
keyGroupConfig} -> KeyGroupConfig
keyGroupConfig) (\s :: KeyGroup
s@KeyGroup' {} KeyGroupConfig
a -> KeyGroup
s {$sel:keyGroupConfig:KeyGroup' :: KeyGroupConfig
keyGroupConfig = KeyGroupConfig
a} :: KeyGroup)
instance Data.FromXML KeyGroup where
parseXML :: [Node] -> Either String KeyGroup
parseXML [Node]
x =
Text -> ISO8601 -> KeyGroupConfig -> KeyGroup
KeyGroup'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"LastModifiedTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"KeyGroupConfig")
instance Prelude.Hashable KeyGroup where
hashWithSalt :: Int -> KeyGroup -> Int
hashWithSalt Int
_salt KeyGroup' {Text
ISO8601
KeyGroupConfig
keyGroupConfig :: KeyGroupConfig
lastModifiedTime :: ISO8601
id :: Text
$sel:keyGroupConfig:KeyGroup' :: KeyGroup -> KeyGroupConfig
$sel:lastModifiedTime:KeyGroup' :: KeyGroup -> ISO8601
$sel:id:KeyGroup' :: KeyGroup -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
lastModifiedTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` KeyGroupConfig
keyGroupConfig
instance Prelude.NFData KeyGroup where
rnf :: KeyGroup -> ()
rnf KeyGroup' {Text
ISO8601
KeyGroupConfig
keyGroupConfig :: KeyGroupConfig
lastModifiedTime :: ISO8601
id :: Text
$sel:keyGroupConfig:KeyGroup' :: KeyGroup -> KeyGroupConfig
$sel:lastModifiedTime:KeyGroup' :: KeyGroup -> ISO8601
$sel:id:KeyGroup' :: KeyGroup -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
lastModifiedTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf KeyGroupConfig
keyGroupConfig