{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CidrAuthorizationContext = CidrAuthorizationContext'
{
CidrAuthorizationContext -> Text
message :: Prelude.Text,
CidrAuthorizationContext -> Text
signature :: Prelude.Text
}
deriving (CidrAuthorizationContext -> CidrAuthorizationContext -> Bool
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]
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
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.
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'
{ $sel:message:CidrAuthorizationContext' :: Text
message = Text
pMessage_,
$sel:signature:CidrAuthorizationContext' :: Text
signature = Text
pSignature_
}
cidrAuthorizationContext_message :: Lens.Lens' CidrAuthorizationContext Prelude.Text
cidrAuthorizationContext_message :: Lens' CidrAuthorizationContext Text
cidrAuthorizationContext_message = 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 :: Lens' CidrAuthorizationContext Text
cidrAuthorizationContext_signature = 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 where
hashWithSalt :: Int -> CidrAuthorizationContext -> Int
hashWithSalt Int
_salt CidrAuthorizationContext' {Text
signature :: Text
message :: Text
$sel:signature:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
$sel:message:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
signature
instance Prelude.NFData CidrAuthorizationContext where
rnf :: CidrAuthorizationContext -> ()
rnf CidrAuthorizationContext' {Text
signature :: Text
message :: Text
$sel:signature:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
$sel:message:CidrAuthorizationContext' :: CidrAuthorizationContext -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
signature
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"Message" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
message),
forall a. a -> Maybe a
Prelude.Just (Key
"Signature" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
signature)
]
)