{-# 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.KGKeyPairIds
-- 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.KGKeyPairIds where

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

-- | A list of identifiers for the public keys that CloudFront can use to
-- verify the signatures of signed URLs and signed cookies.
--
-- /See:/ 'newKGKeyPairIds' smart constructor.
data KGKeyPairIds = KGKeyPairIds'
  { KGKeyPairIds -> Maybe KeyPairIds
keyPairIds :: Prelude.Maybe KeyPairIds,
    -- | The identifier of the key group that contains the public keys.
    KGKeyPairIds -> Maybe Text
keyGroupId :: Prelude.Maybe Prelude.Text
  }
  deriving (KGKeyPairIds -> KGKeyPairIds -> Bool
(KGKeyPairIds -> KGKeyPairIds -> Bool)
-> (KGKeyPairIds -> KGKeyPairIds -> Bool) -> Eq KGKeyPairIds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KGKeyPairIds -> KGKeyPairIds -> Bool
$c/= :: KGKeyPairIds -> KGKeyPairIds -> Bool
== :: KGKeyPairIds -> KGKeyPairIds -> Bool
$c== :: KGKeyPairIds -> KGKeyPairIds -> Bool
Prelude.Eq, ReadPrec [KGKeyPairIds]
ReadPrec KGKeyPairIds
Int -> ReadS KGKeyPairIds
ReadS [KGKeyPairIds]
(Int -> ReadS KGKeyPairIds)
-> ReadS [KGKeyPairIds]
-> ReadPrec KGKeyPairIds
-> ReadPrec [KGKeyPairIds]
-> Read KGKeyPairIds
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KGKeyPairIds]
$creadListPrec :: ReadPrec [KGKeyPairIds]
readPrec :: ReadPrec KGKeyPairIds
$creadPrec :: ReadPrec KGKeyPairIds
readList :: ReadS [KGKeyPairIds]
$creadList :: ReadS [KGKeyPairIds]
readsPrec :: Int -> ReadS KGKeyPairIds
$creadsPrec :: Int -> ReadS KGKeyPairIds
Prelude.Read, Int -> KGKeyPairIds -> ShowS
[KGKeyPairIds] -> ShowS
KGKeyPairIds -> String
(Int -> KGKeyPairIds -> ShowS)
-> (KGKeyPairIds -> String)
-> ([KGKeyPairIds] -> ShowS)
-> Show KGKeyPairIds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KGKeyPairIds] -> ShowS
$cshowList :: [KGKeyPairIds] -> ShowS
show :: KGKeyPairIds -> String
$cshow :: KGKeyPairIds -> String
showsPrec :: Int -> KGKeyPairIds -> ShowS
$cshowsPrec :: Int -> KGKeyPairIds -> ShowS
Prelude.Show, (forall x. KGKeyPairIds -> Rep KGKeyPairIds x)
-> (forall x. Rep KGKeyPairIds x -> KGKeyPairIds)
-> Generic KGKeyPairIds
forall x. Rep KGKeyPairIds x -> KGKeyPairIds
forall x. KGKeyPairIds -> Rep KGKeyPairIds x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KGKeyPairIds x -> KGKeyPairIds
$cfrom :: forall x. KGKeyPairIds -> Rep KGKeyPairIds x
Prelude.Generic)

-- |
-- Create a value of 'KGKeyPairIds' 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:
--
-- 'keyPairIds', 'kGKeyPairIds_keyPairIds' - Undocumented member.
--
-- 'keyGroupId', 'kGKeyPairIds_keyGroupId' - The identifier of the key group that contains the public keys.
newKGKeyPairIds ::
  KGKeyPairIds
newKGKeyPairIds :: KGKeyPairIds
newKGKeyPairIds =
  KGKeyPairIds' :: Maybe KeyPairIds -> Maybe Text -> KGKeyPairIds
KGKeyPairIds'
    { $sel:keyPairIds:KGKeyPairIds' :: Maybe KeyPairIds
keyPairIds = Maybe KeyPairIds
forall a. Maybe a
Prelude.Nothing,
      $sel:keyGroupId:KGKeyPairIds' :: Maybe Text
keyGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
kGKeyPairIds_keyPairIds :: Lens.Lens' KGKeyPairIds (Prelude.Maybe KeyPairIds)
kGKeyPairIds_keyPairIds :: (Maybe KeyPairIds -> f (Maybe KeyPairIds))
-> KGKeyPairIds -> f KGKeyPairIds
kGKeyPairIds_keyPairIds = (KGKeyPairIds -> Maybe KeyPairIds)
-> (KGKeyPairIds -> Maybe KeyPairIds -> KGKeyPairIds)
-> Lens
     KGKeyPairIds KGKeyPairIds (Maybe KeyPairIds) (Maybe KeyPairIds)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KGKeyPairIds' {Maybe KeyPairIds
keyPairIds :: Maybe KeyPairIds
$sel:keyPairIds:KGKeyPairIds' :: KGKeyPairIds -> Maybe KeyPairIds
keyPairIds} -> Maybe KeyPairIds
keyPairIds) (\s :: KGKeyPairIds
s@KGKeyPairIds' {} Maybe KeyPairIds
a -> KGKeyPairIds
s {$sel:keyPairIds:KGKeyPairIds' :: Maybe KeyPairIds
keyPairIds = Maybe KeyPairIds
a} :: KGKeyPairIds)

-- | The identifier of the key group that contains the public keys.
kGKeyPairIds_keyGroupId :: Lens.Lens' KGKeyPairIds (Prelude.Maybe Prelude.Text)
kGKeyPairIds_keyGroupId :: (Maybe Text -> f (Maybe Text)) -> KGKeyPairIds -> f KGKeyPairIds
kGKeyPairIds_keyGroupId = (KGKeyPairIds -> Maybe Text)
-> (KGKeyPairIds -> Maybe Text -> KGKeyPairIds)
-> Lens KGKeyPairIds KGKeyPairIds (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KGKeyPairIds' {Maybe Text
keyGroupId :: Maybe Text
$sel:keyGroupId:KGKeyPairIds' :: KGKeyPairIds -> Maybe Text
keyGroupId} -> Maybe Text
keyGroupId) (\s :: KGKeyPairIds
s@KGKeyPairIds' {} Maybe Text
a -> KGKeyPairIds
s {$sel:keyGroupId:KGKeyPairIds' :: Maybe Text
keyGroupId = Maybe Text
a} :: KGKeyPairIds)

instance Core.FromXML KGKeyPairIds where
  parseXML :: [Node] -> Either String KGKeyPairIds
parseXML [Node]
x =
    Maybe KeyPairIds -> Maybe Text -> KGKeyPairIds
KGKeyPairIds'
      (Maybe KeyPairIds -> Maybe Text -> KGKeyPairIds)
-> Either String (Maybe KeyPairIds)
-> Either String (Maybe Text -> KGKeyPairIds)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe KeyPairIds)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"KeyPairIds")
      Either String (Maybe Text -> KGKeyPairIds)
-> Either String (Maybe Text) -> Either String KGKeyPairIds
forall (f :: * -> *) a b. Applicative f => 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
"KeyGroupId")

instance Prelude.Hashable KGKeyPairIds

instance Prelude.NFData KGKeyPairIds