{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudFront.Types.KeyGroupSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFront.Types.KeyGroupSummary where

import Amazonka.CloudFront.Types.KeyGroup
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a key group.
--
-- /See:/ 'newKeyGroupSummary' smart constructor.
data KeyGroupSummary = KeyGroupSummary'
  { -- | A key group.
    KeyGroupSummary -> KeyGroup
keyGroup :: KeyGroup
  }
  deriving (KeyGroupSummary -> KeyGroupSummary -> Bool
(KeyGroupSummary -> KeyGroupSummary -> Bool)
-> (KeyGroupSummary -> KeyGroupSummary -> Bool)
-> Eq KeyGroupSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeyGroupSummary -> KeyGroupSummary -> Bool
$c/= :: KeyGroupSummary -> KeyGroupSummary -> Bool
== :: KeyGroupSummary -> KeyGroupSummary -> Bool
$c== :: KeyGroupSummary -> KeyGroupSummary -> Bool
Prelude.Eq, ReadPrec [KeyGroupSummary]
ReadPrec KeyGroupSummary
Int -> ReadS KeyGroupSummary
ReadS [KeyGroupSummary]
(Int -> ReadS KeyGroupSummary)
-> ReadS [KeyGroupSummary]
-> ReadPrec KeyGroupSummary
-> ReadPrec [KeyGroupSummary]
-> Read KeyGroupSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KeyGroupSummary]
$creadListPrec :: ReadPrec [KeyGroupSummary]
readPrec :: ReadPrec KeyGroupSummary
$creadPrec :: ReadPrec KeyGroupSummary
readList :: ReadS [KeyGroupSummary]
$creadList :: ReadS [KeyGroupSummary]
readsPrec :: Int -> ReadS KeyGroupSummary
$creadsPrec :: Int -> ReadS KeyGroupSummary
Prelude.Read, Int -> KeyGroupSummary -> ShowS
[KeyGroupSummary] -> ShowS
KeyGroupSummary -> String
(Int -> KeyGroupSummary -> ShowS)
-> (KeyGroupSummary -> String)
-> ([KeyGroupSummary] -> ShowS)
-> Show KeyGroupSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeyGroupSummary] -> ShowS
$cshowList :: [KeyGroupSummary] -> ShowS
show :: KeyGroupSummary -> String
$cshow :: KeyGroupSummary -> String
showsPrec :: Int -> KeyGroupSummary -> ShowS
$cshowsPrec :: Int -> KeyGroupSummary -> ShowS
Prelude.Show, (forall x. KeyGroupSummary -> Rep KeyGroupSummary x)
-> (forall x. Rep KeyGroupSummary x -> KeyGroupSummary)
-> Generic KeyGroupSummary
forall x. Rep KeyGroupSummary x -> KeyGroupSummary
forall x. KeyGroupSummary -> Rep KeyGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeyGroupSummary x -> KeyGroupSummary
$cfrom :: forall x. KeyGroupSummary -> Rep KeyGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'KeyGroupSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'keyGroup', 'keyGroupSummary_keyGroup' - A key group.
newKeyGroupSummary ::
  -- | 'keyGroup'
  KeyGroup ->
  KeyGroupSummary
newKeyGroupSummary :: KeyGroup -> KeyGroupSummary
newKeyGroupSummary KeyGroup
pKeyGroup_ =
  KeyGroupSummary' :: KeyGroup -> KeyGroupSummary
KeyGroupSummary' {$sel:keyGroup:KeyGroupSummary' :: KeyGroup
keyGroup = KeyGroup
pKeyGroup_}

-- | A key group.
keyGroupSummary_keyGroup :: Lens.Lens' KeyGroupSummary KeyGroup
keyGroupSummary_keyGroup :: (KeyGroup -> f KeyGroup) -> KeyGroupSummary -> f KeyGroupSummary
keyGroupSummary_keyGroup = (KeyGroupSummary -> KeyGroup)
-> (KeyGroupSummary -> KeyGroup -> KeyGroupSummary)
-> Lens KeyGroupSummary KeyGroupSummary KeyGroup KeyGroup
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeyGroupSummary' {KeyGroup
keyGroup :: KeyGroup
$sel:keyGroup:KeyGroupSummary' :: KeyGroupSummary -> KeyGroup
keyGroup} -> KeyGroup
keyGroup) (\s :: KeyGroupSummary
s@KeyGroupSummary' {} KeyGroup
a -> KeyGroupSummary
s {$sel:keyGroup:KeyGroupSummary' :: KeyGroup
keyGroup = KeyGroup
a} :: KeyGroupSummary)

instance Core.FromXML KeyGroupSummary where
  parseXML :: [Node] -> Either String KeyGroupSummary
parseXML [Node]
x =
    KeyGroup -> KeyGroupSummary
KeyGroupSummary' (KeyGroup -> KeyGroupSummary)
-> Either String KeyGroup -> Either String KeyGroupSummary
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String KeyGroup
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"KeyGroup")

instance Prelude.Hashable KeyGroupSummary

instance Prelude.NFData KeyGroupSummary