{-# 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.GlobalAccelerator.Types.CidrAuthorizationContext where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CidrAuthorizationContext = CidrAuthorizationContext'
{
CidrAuthorizationContext -> Text
message :: Prelude.Text,
CidrAuthorizationContext -> Text
signature :: Prelude.Text
}
deriving (CidrAuthorizationContext -> CidrAuthorizationContext -> Bool
(CidrAuthorizationContext -> CidrAuthorizationContext -> Bool)
-> (CidrAuthorizationContext -> CidrAuthorizationContext -> Bool)
-> Eq CidrAuthorizationContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CidrAuthorizationContext -> CidrAuthorizationContext -> Bool
$c/= :: CidrAuthorizationContext -> CidrAuthorizationContext -> Bool
== :: CidrAuthorizationContext -> CidrAuthorizationContext -> Bool
$c== :: CidrAuthorizationContext -> CidrAuthorizationContext -> Bool
Prelude.Eq, ReadPrec [CidrAuthorizationContext]
ReadPrec CidrAuthorizationContext
Int -> ReadS CidrAuthorizationContext
ReadS [CidrAuthorizationContext]
(Int -> ReadS CidrAuthorizationContext)
-> ReadS [CidrAuthorizationContext]
-> ReadPrec CidrAuthorizationContext
-> ReadPrec [CidrAuthorizationContext]
-> Read CidrAuthorizationContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CidrAuthorizationContext]
$creadListPrec :: ReadPrec [CidrAuthorizationContext]
readPrec :: ReadPrec CidrAuthorizationContext
$creadPrec :: ReadPrec CidrAuthorizationContext
readList :: ReadS [CidrAuthorizationContext]
$creadList :: ReadS [CidrAuthorizationContext]
readsPrec :: Int -> ReadS CidrAuthorizationContext
$creadsPrec :: Int -> ReadS CidrAuthorizationContext
Prelude.Read, Int -> CidrAuthorizationContext -> ShowS
[CidrAuthorizationContext] -> ShowS
CidrAuthorizationContext -> String
(Int -> CidrAuthorizationContext -> ShowS)
-> (CidrAuthorizationContext -> String)
-> ([CidrAuthorizationContext] -> ShowS)
-> Show CidrAuthorizationContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CidrAuthorizationContext] -> ShowS
$cshowList :: [CidrAuthorizationContext] -> ShowS
show :: CidrAuthorizationContext -> String
$cshow :: CidrAuthorizationContext -> String
showsPrec :: Int -> CidrAuthorizationContext -> ShowS
$cshowsPrec :: Int -> CidrAuthorizationContext -> ShowS
Prelude.Show, (forall x.
CidrAuthorizationContext -> Rep CidrAuthorizationContext x)
-> (forall x.
Rep CidrAuthorizationContext x -> CidrAuthorizationContext)
-> Generic CidrAuthorizationContext
forall x.
Rep CidrAuthorizationContext x -> CidrAuthorizationContext
forall x.
CidrAuthorizationContext -> Rep CidrAuthorizationContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CidrAuthorizationContext x -> CidrAuthorizationContext
$cfrom :: forall x.
CidrAuthorizationContext -> Rep CidrAuthorizationContext x
Prelude.Generic)
newCidrAuthorizationContext ::
Prelude.Text ->
Prelude.Text ->
CidrAuthorizationContext
newCidrAuthorizationContext :: Text -> Text -> CidrAuthorizationContext
newCidrAuthorizationContext Text
pMessage_ Text
pSignature_ =
CidrAuthorizationContext' :: Text -> Text -> CidrAuthorizationContext
CidrAuthorizationContext'
{ $sel:message:CidrAuthorizationContext' :: Text
message = Text
pMessage_,
$sel:signature:CidrAuthorizationContext' :: Text
signature = Text
pSignature_
}
cidrAuthorizationContext_message :: Lens.Lens' CidrAuthorizationContext Prelude.Text
cidrAuthorizationContext_message :: (Text -> f Text)
-> CidrAuthorizationContext -> f CidrAuthorizationContext
cidrAuthorizationContext_message = (CidrAuthorizationContext -> Text)
-> (CidrAuthorizationContext -> Text -> CidrAuthorizationContext)
-> Lens CidrAuthorizationContext CidrAuthorizationContext Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CidrAuthorizationContext' {Text
message :: Text
$sel:message:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
message} -> Text
message) (\s :: CidrAuthorizationContext
s@CidrAuthorizationContext' {} Text
a -> CidrAuthorizationContext
s {$sel:message:CidrAuthorizationContext' :: Text
message = Text
a} :: CidrAuthorizationContext)
cidrAuthorizationContext_signature :: Lens.Lens' CidrAuthorizationContext Prelude.Text
cidrAuthorizationContext_signature :: (Text -> f Text)
-> CidrAuthorizationContext -> f CidrAuthorizationContext
cidrAuthorizationContext_signature = (CidrAuthorizationContext -> Text)
-> (CidrAuthorizationContext -> Text -> CidrAuthorizationContext)
-> Lens CidrAuthorizationContext CidrAuthorizationContext Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CidrAuthorizationContext' {Text
signature :: Text
$sel:signature:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
signature} -> Text
signature) (\s :: CidrAuthorizationContext
s@CidrAuthorizationContext' {} Text
a -> CidrAuthorizationContext
s {$sel:signature:CidrAuthorizationContext' :: Text
signature = Text
a} :: CidrAuthorizationContext)
instance Prelude.Hashable CidrAuthorizationContext
instance Prelude.NFData CidrAuthorizationContext
instance Core.ToJSON CidrAuthorizationContext where
toJSON :: CidrAuthorizationContext -> Value
toJSON CidrAuthorizationContext' {Text
signature :: Text
message :: Text
$sel:signature:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
$sel:message:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Message" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
message),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Signature" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
signature)
]
)