{-# 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.CloudWatchEvents.Types.CreateConnectionOAuthRequestParameters where
import Amazonka.CloudWatchEvents.Types.ConnectionHttpParameters
import Amazonka.CloudWatchEvents.Types.ConnectionOAuthHttpMethod
import Amazonka.CloudWatchEvents.Types.CreateConnectionOAuthClientRequestParameters
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CreateConnectionOAuthRequestParameters = CreateConnectionOAuthRequestParameters'
{
CreateConnectionOAuthRequestParameters
-> Maybe ConnectionHttpParameters
oAuthHttpParameters :: Prelude.Maybe ConnectionHttpParameters,
CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthClientRequestParameters
clientParameters :: CreateConnectionOAuthClientRequestParameters,
CreateConnectionOAuthRequestParameters -> Text
authorizationEndpoint :: Prelude.Text,
CreateConnectionOAuthRequestParameters -> ConnectionOAuthHttpMethod
httpMethod :: ConnectionOAuthHttpMethod
}
deriving (CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthRequestParameters -> Bool
(CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthRequestParameters -> Bool)
-> (CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthRequestParameters -> Bool)
-> Eq CreateConnectionOAuthRequestParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthRequestParameters -> Bool
$c/= :: CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthRequestParameters -> Bool
== :: CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthRequestParameters -> Bool
$c== :: CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthRequestParameters -> Bool
Prelude.Eq, ReadPrec [CreateConnectionOAuthRequestParameters]
ReadPrec CreateConnectionOAuthRequestParameters
Int -> ReadS CreateConnectionOAuthRequestParameters
ReadS [CreateConnectionOAuthRequestParameters]
(Int -> ReadS CreateConnectionOAuthRequestParameters)
-> ReadS [CreateConnectionOAuthRequestParameters]
-> ReadPrec CreateConnectionOAuthRequestParameters
-> ReadPrec [CreateConnectionOAuthRequestParameters]
-> Read CreateConnectionOAuthRequestParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateConnectionOAuthRequestParameters]
$creadListPrec :: ReadPrec [CreateConnectionOAuthRequestParameters]
readPrec :: ReadPrec CreateConnectionOAuthRequestParameters
$creadPrec :: ReadPrec CreateConnectionOAuthRequestParameters
readList :: ReadS [CreateConnectionOAuthRequestParameters]
$creadList :: ReadS [CreateConnectionOAuthRequestParameters]
readsPrec :: Int -> ReadS CreateConnectionOAuthRequestParameters
$creadsPrec :: Int -> ReadS CreateConnectionOAuthRequestParameters
Prelude.Read, Int -> CreateConnectionOAuthRequestParameters -> ShowS
[CreateConnectionOAuthRequestParameters] -> ShowS
CreateConnectionOAuthRequestParameters -> String
(Int -> CreateConnectionOAuthRequestParameters -> ShowS)
-> (CreateConnectionOAuthRequestParameters -> String)
-> ([CreateConnectionOAuthRequestParameters] -> ShowS)
-> Show CreateConnectionOAuthRequestParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateConnectionOAuthRequestParameters] -> ShowS
$cshowList :: [CreateConnectionOAuthRequestParameters] -> ShowS
show :: CreateConnectionOAuthRequestParameters -> String
$cshow :: CreateConnectionOAuthRequestParameters -> String
showsPrec :: Int -> CreateConnectionOAuthRequestParameters -> ShowS
$cshowsPrec :: Int -> CreateConnectionOAuthRequestParameters -> ShowS
Prelude.Show, (forall x.
CreateConnectionOAuthRequestParameters
-> Rep CreateConnectionOAuthRequestParameters x)
-> (forall x.
Rep CreateConnectionOAuthRequestParameters x
-> CreateConnectionOAuthRequestParameters)
-> Generic CreateConnectionOAuthRequestParameters
forall x.
Rep CreateConnectionOAuthRequestParameters x
-> CreateConnectionOAuthRequestParameters
forall x.
CreateConnectionOAuthRequestParameters
-> Rep CreateConnectionOAuthRequestParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateConnectionOAuthRequestParameters x
-> CreateConnectionOAuthRequestParameters
$cfrom :: forall x.
CreateConnectionOAuthRequestParameters
-> Rep CreateConnectionOAuthRequestParameters x
Prelude.Generic)
newCreateConnectionOAuthRequestParameters ::
CreateConnectionOAuthClientRequestParameters ->
Prelude.Text ->
ConnectionOAuthHttpMethod ->
CreateConnectionOAuthRequestParameters
newCreateConnectionOAuthRequestParameters :: CreateConnectionOAuthClientRequestParameters
-> Text
-> ConnectionOAuthHttpMethod
-> CreateConnectionOAuthRequestParameters
newCreateConnectionOAuthRequestParameters
CreateConnectionOAuthClientRequestParameters
pClientParameters_
Text
pAuthorizationEndpoint_
ConnectionOAuthHttpMethod
pHttpMethod_ =
CreateConnectionOAuthRequestParameters' :: Maybe ConnectionHttpParameters
-> CreateConnectionOAuthClientRequestParameters
-> Text
-> ConnectionOAuthHttpMethod
-> CreateConnectionOAuthRequestParameters
CreateConnectionOAuthRequestParameters'
{ $sel:oAuthHttpParameters:CreateConnectionOAuthRequestParameters' :: Maybe ConnectionHttpParameters
oAuthHttpParameters =
Maybe ConnectionHttpParameters
forall a. Maybe a
Prelude.Nothing,
$sel:clientParameters:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthClientRequestParameters
clientParameters =
CreateConnectionOAuthClientRequestParameters
pClientParameters_,
$sel:authorizationEndpoint:CreateConnectionOAuthRequestParameters' :: Text
authorizationEndpoint =
Text
pAuthorizationEndpoint_,
$sel:httpMethod:CreateConnectionOAuthRequestParameters' :: ConnectionOAuthHttpMethod
httpMethod = ConnectionOAuthHttpMethod
pHttpMethod_
}
createConnectionOAuthRequestParameters_oAuthHttpParameters :: Lens.Lens' CreateConnectionOAuthRequestParameters (Prelude.Maybe ConnectionHttpParameters)
createConnectionOAuthRequestParameters_oAuthHttpParameters :: (Maybe ConnectionHttpParameters
-> f (Maybe ConnectionHttpParameters))
-> CreateConnectionOAuthRequestParameters
-> f CreateConnectionOAuthRequestParameters
createConnectionOAuthRequestParameters_oAuthHttpParameters = (CreateConnectionOAuthRequestParameters
-> Maybe ConnectionHttpParameters)
-> (CreateConnectionOAuthRequestParameters
-> Maybe ConnectionHttpParameters
-> CreateConnectionOAuthRequestParameters)
-> Lens
CreateConnectionOAuthRequestParameters
CreateConnectionOAuthRequestParameters
(Maybe ConnectionHttpParameters)
(Maybe ConnectionHttpParameters)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionOAuthRequestParameters' {Maybe ConnectionHttpParameters
oAuthHttpParameters :: Maybe ConnectionHttpParameters
$sel:oAuthHttpParameters:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters
-> Maybe ConnectionHttpParameters
oAuthHttpParameters} -> Maybe ConnectionHttpParameters
oAuthHttpParameters) (\s :: CreateConnectionOAuthRequestParameters
s@CreateConnectionOAuthRequestParameters' {} Maybe ConnectionHttpParameters
a -> CreateConnectionOAuthRequestParameters
s {$sel:oAuthHttpParameters:CreateConnectionOAuthRequestParameters' :: Maybe ConnectionHttpParameters
oAuthHttpParameters = Maybe ConnectionHttpParameters
a} :: CreateConnectionOAuthRequestParameters)
createConnectionOAuthRequestParameters_clientParameters :: Lens.Lens' CreateConnectionOAuthRequestParameters CreateConnectionOAuthClientRequestParameters
createConnectionOAuthRequestParameters_clientParameters :: (CreateConnectionOAuthClientRequestParameters
-> f CreateConnectionOAuthClientRequestParameters)
-> CreateConnectionOAuthRequestParameters
-> f CreateConnectionOAuthRequestParameters
createConnectionOAuthRequestParameters_clientParameters = (CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthClientRequestParameters)
-> (CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthClientRequestParameters
-> CreateConnectionOAuthRequestParameters)
-> Lens
CreateConnectionOAuthRequestParameters
CreateConnectionOAuthRequestParameters
CreateConnectionOAuthClientRequestParameters
CreateConnectionOAuthClientRequestParameters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionOAuthRequestParameters' {CreateConnectionOAuthClientRequestParameters
clientParameters :: CreateConnectionOAuthClientRequestParameters
$sel:clientParameters:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthClientRequestParameters
clientParameters} -> CreateConnectionOAuthClientRequestParameters
clientParameters) (\s :: CreateConnectionOAuthRequestParameters
s@CreateConnectionOAuthRequestParameters' {} CreateConnectionOAuthClientRequestParameters
a -> CreateConnectionOAuthRequestParameters
s {$sel:clientParameters:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthClientRequestParameters
clientParameters = CreateConnectionOAuthClientRequestParameters
a} :: CreateConnectionOAuthRequestParameters)
createConnectionOAuthRequestParameters_authorizationEndpoint :: Lens.Lens' CreateConnectionOAuthRequestParameters Prelude.Text
createConnectionOAuthRequestParameters_authorizationEndpoint :: (Text -> f Text)
-> CreateConnectionOAuthRequestParameters
-> f CreateConnectionOAuthRequestParameters
createConnectionOAuthRequestParameters_authorizationEndpoint = (CreateConnectionOAuthRequestParameters -> Text)
-> (CreateConnectionOAuthRequestParameters
-> Text -> CreateConnectionOAuthRequestParameters)
-> Lens
CreateConnectionOAuthRequestParameters
CreateConnectionOAuthRequestParameters
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionOAuthRequestParameters' {Text
authorizationEndpoint :: Text
$sel:authorizationEndpoint:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters -> Text
authorizationEndpoint} -> Text
authorizationEndpoint) (\s :: CreateConnectionOAuthRequestParameters
s@CreateConnectionOAuthRequestParameters' {} Text
a -> CreateConnectionOAuthRequestParameters
s {$sel:authorizationEndpoint:CreateConnectionOAuthRequestParameters' :: Text
authorizationEndpoint = Text
a} :: CreateConnectionOAuthRequestParameters)
createConnectionOAuthRequestParameters_httpMethod :: Lens.Lens' CreateConnectionOAuthRequestParameters ConnectionOAuthHttpMethod
createConnectionOAuthRequestParameters_httpMethod :: (ConnectionOAuthHttpMethod -> f ConnectionOAuthHttpMethod)
-> CreateConnectionOAuthRequestParameters
-> f CreateConnectionOAuthRequestParameters
createConnectionOAuthRequestParameters_httpMethod = (CreateConnectionOAuthRequestParameters
-> ConnectionOAuthHttpMethod)
-> (CreateConnectionOAuthRequestParameters
-> ConnectionOAuthHttpMethod
-> CreateConnectionOAuthRequestParameters)
-> Lens
CreateConnectionOAuthRequestParameters
CreateConnectionOAuthRequestParameters
ConnectionOAuthHttpMethod
ConnectionOAuthHttpMethod
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateConnectionOAuthRequestParameters' {ConnectionOAuthHttpMethod
httpMethod :: ConnectionOAuthHttpMethod
$sel:httpMethod:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters -> ConnectionOAuthHttpMethod
httpMethod} -> ConnectionOAuthHttpMethod
httpMethod) (\s :: CreateConnectionOAuthRequestParameters
s@CreateConnectionOAuthRequestParameters' {} ConnectionOAuthHttpMethod
a -> CreateConnectionOAuthRequestParameters
s {$sel:httpMethod:CreateConnectionOAuthRequestParameters' :: ConnectionOAuthHttpMethod
httpMethod = ConnectionOAuthHttpMethod
a} :: CreateConnectionOAuthRequestParameters)
instance
Prelude.Hashable
CreateConnectionOAuthRequestParameters
instance
Prelude.NFData
CreateConnectionOAuthRequestParameters
instance
Core.ToJSON
CreateConnectionOAuthRequestParameters
where
toJSON :: CreateConnectionOAuthRequestParameters -> Value
toJSON CreateConnectionOAuthRequestParameters' {Maybe ConnectionHttpParameters
Text
ConnectionOAuthHttpMethod
CreateConnectionOAuthClientRequestParameters
httpMethod :: ConnectionOAuthHttpMethod
authorizationEndpoint :: Text
clientParameters :: CreateConnectionOAuthClientRequestParameters
oAuthHttpParameters :: Maybe ConnectionHttpParameters
$sel:httpMethod:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters -> ConnectionOAuthHttpMethod
$sel:authorizationEndpoint:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters -> Text
$sel:clientParameters:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters
-> CreateConnectionOAuthClientRequestParameters
$sel:oAuthHttpParameters:CreateConnectionOAuthRequestParameters' :: CreateConnectionOAuthRequestParameters
-> Maybe ConnectionHttpParameters
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"OAuthHttpParameters" Text -> ConnectionHttpParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ConnectionHttpParameters -> Pair)
-> Maybe ConnectionHttpParameters -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectionHttpParameters
oAuthHttpParameters,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ClientParameters" Text -> CreateConnectionOAuthClientRequestParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= CreateConnectionOAuthClientRequestParameters
clientParameters),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"AuthorizationEndpoint"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
authorizationEndpoint
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"HttpMethod" Text -> ConnectionOAuthHttpMethod -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ConnectionOAuthHttpMethod
httpMethod)
]
)