{-# 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.ActiveTrustedKeyGroups where
import Amazonka.CloudFront.Types.KGKeyPairIds
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 ActiveTrustedKeyGroups = ActiveTrustedKeyGroups'
{
ActiveTrustedKeyGroups -> Maybe [KGKeyPairIds]
items :: Prelude.Maybe [KGKeyPairIds],
ActiveTrustedKeyGroups -> Bool
enabled :: Prelude.Bool,
ActiveTrustedKeyGroups -> Int
quantity :: Prelude.Int
}
deriving (ActiveTrustedKeyGroups -> ActiveTrustedKeyGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActiveTrustedKeyGroups -> ActiveTrustedKeyGroups -> Bool
$c/= :: ActiveTrustedKeyGroups -> ActiveTrustedKeyGroups -> Bool
== :: ActiveTrustedKeyGroups -> ActiveTrustedKeyGroups -> Bool
$c== :: ActiveTrustedKeyGroups -> ActiveTrustedKeyGroups -> Bool
Prelude.Eq, ReadPrec [ActiveTrustedKeyGroups]
ReadPrec ActiveTrustedKeyGroups
Int -> ReadS ActiveTrustedKeyGroups
ReadS [ActiveTrustedKeyGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActiveTrustedKeyGroups]
$creadListPrec :: ReadPrec [ActiveTrustedKeyGroups]
readPrec :: ReadPrec ActiveTrustedKeyGroups
$creadPrec :: ReadPrec ActiveTrustedKeyGroups
readList :: ReadS [ActiveTrustedKeyGroups]
$creadList :: ReadS [ActiveTrustedKeyGroups]
readsPrec :: Int -> ReadS ActiveTrustedKeyGroups
$creadsPrec :: Int -> ReadS ActiveTrustedKeyGroups
Prelude.Read, Int -> ActiveTrustedKeyGroups -> ShowS
[ActiveTrustedKeyGroups] -> ShowS
ActiveTrustedKeyGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActiveTrustedKeyGroups] -> ShowS
$cshowList :: [ActiveTrustedKeyGroups] -> ShowS
show :: ActiveTrustedKeyGroups -> String
$cshow :: ActiveTrustedKeyGroups -> String
showsPrec :: Int -> ActiveTrustedKeyGroups -> ShowS
$cshowsPrec :: Int -> ActiveTrustedKeyGroups -> ShowS
Prelude.Show, forall x. Rep ActiveTrustedKeyGroups x -> ActiveTrustedKeyGroups
forall x. ActiveTrustedKeyGroups -> Rep ActiveTrustedKeyGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActiveTrustedKeyGroups x -> ActiveTrustedKeyGroups
$cfrom :: forall x. ActiveTrustedKeyGroups -> Rep ActiveTrustedKeyGroups x
Prelude.Generic)
newActiveTrustedKeyGroups ::
Prelude.Bool ->
Prelude.Int ->
ActiveTrustedKeyGroups
newActiveTrustedKeyGroups :: Bool -> Int -> ActiveTrustedKeyGroups
newActiveTrustedKeyGroups Bool
pEnabled_ Int
pQuantity_ =
ActiveTrustedKeyGroups'
{ $sel:items:ActiveTrustedKeyGroups' :: Maybe [KGKeyPairIds]
items = forall a. Maybe a
Prelude.Nothing,
$sel:enabled:ActiveTrustedKeyGroups' :: Bool
enabled = Bool
pEnabled_,
$sel:quantity:ActiveTrustedKeyGroups' :: Int
quantity = Int
pQuantity_
}
activeTrustedKeyGroups_items :: Lens.Lens' ActiveTrustedKeyGroups (Prelude.Maybe [KGKeyPairIds])
activeTrustedKeyGroups_items :: Lens' ActiveTrustedKeyGroups (Maybe [KGKeyPairIds])
activeTrustedKeyGroups_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveTrustedKeyGroups' {Maybe [KGKeyPairIds]
items :: Maybe [KGKeyPairIds]
$sel:items:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Maybe [KGKeyPairIds]
items} -> Maybe [KGKeyPairIds]
items) (\s :: ActiveTrustedKeyGroups
s@ActiveTrustedKeyGroups' {} Maybe [KGKeyPairIds]
a -> ActiveTrustedKeyGroups
s {$sel:items:ActiveTrustedKeyGroups' :: Maybe [KGKeyPairIds]
items = Maybe [KGKeyPairIds]
a} :: ActiveTrustedKeyGroups) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
activeTrustedKeyGroups_enabled :: Lens.Lens' ActiveTrustedKeyGroups Prelude.Bool
activeTrustedKeyGroups_enabled :: Lens' ActiveTrustedKeyGroups Bool
activeTrustedKeyGroups_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveTrustedKeyGroups' {Bool
enabled :: Bool
$sel:enabled:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Bool
enabled} -> Bool
enabled) (\s :: ActiveTrustedKeyGroups
s@ActiveTrustedKeyGroups' {} Bool
a -> ActiveTrustedKeyGroups
s {$sel:enabled:ActiveTrustedKeyGroups' :: Bool
enabled = Bool
a} :: ActiveTrustedKeyGroups)
activeTrustedKeyGroups_quantity :: Lens.Lens' ActiveTrustedKeyGroups Prelude.Int
activeTrustedKeyGroups_quantity :: Lens' ActiveTrustedKeyGroups Int
activeTrustedKeyGroups_quantity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveTrustedKeyGroups' {Int
quantity :: Int
$sel:quantity:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Int
quantity} -> Int
quantity) (\s :: ActiveTrustedKeyGroups
s@ActiveTrustedKeyGroups' {} Int
a -> ActiveTrustedKeyGroups
s {$sel:quantity:ActiveTrustedKeyGroups' :: Int
quantity = Int
a} :: ActiveTrustedKeyGroups)
instance Data.FromXML ActiveTrustedKeyGroups where
parseXML :: [Node] -> Either String ActiveTrustedKeyGroups
parseXML [Node]
x =
Maybe [KGKeyPairIds] -> Bool -> Int -> ActiveTrustedKeyGroups
ActiveTrustedKeyGroups'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Items"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"KeyGroup")
)
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
"Enabled")
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
"Quantity")
instance Prelude.Hashable ActiveTrustedKeyGroups where
hashWithSalt :: Int -> ActiveTrustedKeyGroups -> Int
hashWithSalt Int
_salt ActiveTrustedKeyGroups' {Bool
Int
Maybe [KGKeyPairIds]
quantity :: Int
enabled :: Bool
items :: Maybe [KGKeyPairIds]
$sel:quantity:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Int
$sel:enabled:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Bool
$sel:items:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Maybe [KGKeyPairIds]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [KGKeyPairIds]
items
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
quantity
instance Prelude.NFData ActiveTrustedKeyGroups where
rnf :: ActiveTrustedKeyGroups -> ()
rnf ActiveTrustedKeyGroups' {Bool
Int
Maybe [KGKeyPairIds]
quantity :: Int
enabled :: Bool
items :: Maybe [KGKeyPairIds]
$sel:quantity:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Int
$sel:enabled:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Bool
$sel:items:ActiveTrustedKeyGroups' :: ActiveTrustedKeyGroups -> Maybe [KGKeyPairIds]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [KGKeyPairIds]
items
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
quantity