{-# 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.Signer where
import Amazonka.CloudFront.Types.KeyPairIds
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Signer = Signer'
{
Signer -> Maybe Text
awsAccountNumber :: Prelude.Maybe Prelude.Text,
Signer -> Maybe KeyPairIds
keyPairIds :: Prelude.Maybe KeyPairIds
}
deriving (Signer -> Signer -> Bool
(Signer -> Signer -> Bool)
-> (Signer -> Signer -> Bool) -> Eq Signer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Signer -> Signer -> Bool
$c/= :: Signer -> Signer -> Bool
== :: Signer -> Signer -> Bool
$c== :: Signer -> Signer -> Bool
Prelude.Eq, ReadPrec [Signer]
ReadPrec Signer
Int -> ReadS Signer
ReadS [Signer]
(Int -> ReadS Signer)
-> ReadS [Signer]
-> ReadPrec Signer
-> ReadPrec [Signer]
-> Read Signer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Signer]
$creadListPrec :: ReadPrec [Signer]
readPrec :: ReadPrec Signer
$creadPrec :: ReadPrec Signer
readList :: ReadS [Signer]
$creadList :: ReadS [Signer]
readsPrec :: Int -> ReadS Signer
$creadsPrec :: Int -> ReadS Signer
Prelude.Read, Int -> Signer -> ShowS
[Signer] -> ShowS
Signer -> String
(Int -> Signer -> ShowS)
-> (Signer -> String) -> ([Signer] -> ShowS) -> Show Signer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Signer] -> ShowS
$cshowList :: [Signer] -> ShowS
show :: Signer -> String
$cshow :: Signer -> String
showsPrec :: Int -> Signer -> ShowS
$cshowsPrec :: Int -> Signer -> ShowS
Prelude.Show, (forall x. Signer -> Rep Signer x)
-> (forall x. Rep Signer x -> Signer) -> Generic Signer
forall x. Rep Signer x -> Signer
forall x. Signer -> Rep Signer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Signer x -> Signer
$cfrom :: forall x. Signer -> Rep Signer x
Prelude.Generic)
newSigner ::
Signer
newSigner :: Signer
newSigner =
Signer' :: Maybe Text -> Maybe KeyPairIds -> Signer
Signer'
{ $sel:awsAccountNumber:Signer' :: Maybe Text
awsAccountNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:keyPairIds:Signer' :: Maybe KeyPairIds
keyPairIds = Maybe KeyPairIds
forall a. Maybe a
Prelude.Nothing
}
signer_awsAccountNumber :: Lens.Lens' Signer (Prelude.Maybe Prelude.Text)
signer_awsAccountNumber :: (Maybe Text -> f (Maybe Text)) -> Signer -> f Signer
signer_awsAccountNumber = (Signer -> Maybe Text)
-> (Signer -> Maybe Text -> Signer)
-> Lens Signer Signer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Signer' {Maybe Text
awsAccountNumber :: Maybe Text
$sel:awsAccountNumber:Signer' :: Signer -> Maybe Text
awsAccountNumber} -> Maybe Text
awsAccountNumber) (\s :: Signer
s@Signer' {} Maybe Text
a -> Signer
s {$sel:awsAccountNumber:Signer' :: Maybe Text
awsAccountNumber = Maybe Text
a} :: Signer)
signer_keyPairIds :: Lens.Lens' Signer (Prelude.Maybe KeyPairIds)
signer_keyPairIds :: (Maybe KeyPairIds -> f (Maybe KeyPairIds)) -> Signer -> f Signer
signer_keyPairIds = (Signer -> Maybe KeyPairIds)
-> (Signer -> Maybe KeyPairIds -> Signer)
-> Lens Signer Signer (Maybe KeyPairIds) (Maybe KeyPairIds)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Signer' {Maybe KeyPairIds
keyPairIds :: Maybe KeyPairIds
$sel:keyPairIds:Signer' :: Signer -> Maybe KeyPairIds
keyPairIds} -> Maybe KeyPairIds
keyPairIds) (\s :: Signer
s@Signer' {} Maybe KeyPairIds
a -> Signer
s {$sel:keyPairIds:Signer' :: Maybe KeyPairIds
keyPairIds = Maybe KeyPairIds
a} :: Signer)
instance Core.FromXML Signer where
parseXML :: [Node] -> Either String Signer
parseXML [Node]
x =
Maybe Text -> Maybe KeyPairIds -> Signer
Signer'
(Maybe Text -> Maybe KeyPairIds -> Signer)
-> Either String (Maybe Text)
-> Either String (Maybe KeyPairIds -> Signer)
forall (f :: * -> *) a b. Functor 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
"AwsAccountNumber")
Either String (Maybe KeyPairIds -> Signer)
-> Either String (Maybe KeyPairIds) -> Either String Signer
forall (f :: * -> *) a b. Applicative f => 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")
instance Prelude.Hashable Signer
instance Prelude.NFData Signer