{-# 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.AppFlow.Types.ConnectorOAuthRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConnectorOAuthRequest = ConnectorOAuthRequest'
{
ConnectorOAuthRequest -> Maybe Text
redirectUri :: Prelude.Maybe Prelude.Text,
ConnectorOAuthRequest -> Maybe Text
authCode :: Prelude.Maybe Prelude.Text
}
deriving (ConnectorOAuthRequest -> ConnectorOAuthRequest -> Bool
(ConnectorOAuthRequest -> ConnectorOAuthRequest -> Bool)
-> (ConnectorOAuthRequest -> ConnectorOAuthRequest -> Bool)
-> Eq ConnectorOAuthRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConnectorOAuthRequest -> ConnectorOAuthRequest -> Bool
$c/= :: ConnectorOAuthRequest -> ConnectorOAuthRequest -> Bool
== :: ConnectorOAuthRequest -> ConnectorOAuthRequest -> Bool
$c== :: ConnectorOAuthRequest -> ConnectorOAuthRequest -> Bool
Prelude.Eq, ReadPrec [ConnectorOAuthRequest]
ReadPrec ConnectorOAuthRequest
Int -> ReadS ConnectorOAuthRequest
ReadS [ConnectorOAuthRequest]
(Int -> ReadS ConnectorOAuthRequest)
-> ReadS [ConnectorOAuthRequest]
-> ReadPrec ConnectorOAuthRequest
-> ReadPrec [ConnectorOAuthRequest]
-> Read ConnectorOAuthRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConnectorOAuthRequest]
$creadListPrec :: ReadPrec [ConnectorOAuthRequest]
readPrec :: ReadPrec ConnectorOAuthRequest
$creadPrec :: ReadPrec ConnectorOAuthRequest
readList :: ReadS [ConnectorOAuthRequest]
$creadList :: ReadS [ConnectorOAuthRequest]
readsPrec :: Int -> ReadS ConnectorOAuthRequest
$creadsPrec :: Int -> ReadS ConnectorOAuthRequest
Prelude.Read, Int -> ConnectorOAuthRequest -> ShowS
[ConnectorOAuthRequest] -> ShowS
ConnectorOAuthRequest -> String
(Int -> ConnectorOAuthRequest -> ShowS)
-> (ConnectorOAuthRequest -> String)
-> ([ConnectorOAuthRequest] -> ShowS)
-> Show ConnectorOAuthRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConnectorOAuthRequest] -> ShowS
$cshowList :: [ConnectorOAuthRequest] -> ShowS
show :: ConnectorOAuthRequest -> String
$cshow :: ConnectorOAuthRequest -> String
showsPrec :: Int -> ConnectorOAuthRequest -> ShowS
$cshowsPrec :: Int -> ConnectorOAuthRequest -> ShowS
Prelude.Show, (forall x. ConnectorOAuthRequest -> Rep ConnectorOAuthRequest x)
-> (forall x. Rep ConnectorOAuthRequest x -> ConnectorOAuthRequest)
-> Generic ConnectorOAuthRequest
forall x. Rep ConnectorOAuthRequest x -> ConnectorOAuthRequest
forall x. ConnectorOAuthRequest -> Rep ConnectorOAuthRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConnectorOAuthRequest x -> ConnectorOAuthRequest
$cfrom :: forall x. ConnectorOAuthRequest -> Rep ConnectorOAuthRequest x
Prelude.Generic)
newConnectorOAuthRequest ::
ConnectorOAuthRequest
newConnectorOAuthRequest :: ConnectorOAuthRequest
newConnectorOAuthRequest =
ConnectorOAuthRequest' :: Maybe Text -> Maybe Text -> ConnectorOAuthRequest
ConnectorOAuthRequest'
{ $sel:redirectUri:ConnectorOAuthRequest' :: Maybe Text
redirectUri =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:authCode:ConnectorOAuthRequest' :: Maybe Text
authCode = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
connectorOAuthRequest_redirectUri :: Lens.Lens' ConnectorOAuthRequest (Prelude.Maybe Prelude.Text)
connectorOAuthRequest_redirectUri :: (Maybe Text -> f (Maybe Text))
-> ConnectorOAuthRequest -> f ConnectorOAuthRequest
connectorOAuthRequest_redirectUri = (ConnectorOAuthRequest -> Maybe Text)
-> (ConnectorOAuthRequest -> Maybe Text -> ConnectorOAuthRequest)
-> Lens
ConnectorOAuthRequest
ConnectorOAuthRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorOAuthRequest' {Maybe Text
redirectUri :: Maybe Text
$sel:redirectUri:ConnectorOAuthRequest' :: ConnectorOAuthRequest -> Maybe Text
redirectUri} -> Maybe Text
redirectUri) (\s :: ConnectorOAuthRequest
s@ConnectorOAuthRequest' {} Maybe Text
a -> ConnectorOAuthRequest
s {$sel:redirectUri:ConnectorOAuthRequest' :: Maybe Text
redirectUri = Maybe Text
a} :: ConnectorOAuthRequest)
connectorOAuthRequest_authCode :: Lens.Lens' ConnectorOAuthRequest (Prelude.Maybe Prelude.Text)
connectorOAuthRequest_authCode :: (Maybe Text -> f (Maybe Text))
-> ConnectorOAuthRequest -> f ConnectorOAuthRequest
connectorOAuthRequest_authCode = (ConnectorOAuthRequest -> Maybe Text)
-> (ConnectorOAuthRequest -> Maybe Text -> ConnectorOAuthRequest)
-> Lens
ConnectorOAuthRequest
ConnectorOAuthRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConnectorOAuthRequest' {Maybe Text
authCode :: Maybe Text
$sel:authCode:ConnectorOAuthRequest' :: ConnectorOAuthRequest -> Maybe Text
authCode} -> Maybe Text
authCode) (\s :: ConnectorOAuthRequest
s@ConnectorOAuthRequest' {} Maybe Text
a -> ConnectorOAuthRequest
s {$sel:authCode:ConnectorOAuthRequest' :: Maybe Text
authCode = Maybe Text
a} :: ConnectorOAuthRequest)
instance Prelude.Hashable ConnectorOAuthRequest
instance Prelude.NFData ConnectorOAuthRequest
instance Core.ToJSON ConnectorOAuthRequest where
toJSON :: ConnectorOAuthRequest -> Value
toJSON ConnectorOAuthRequest' {Maybe Text
authCode :: Maybe Text
redirectUri :: Maybe Text
$sel:authCode:ConnectorOAuthRequest' :: ConnectorOAuthRequest -> Maybe Text
$sel:redirectUri:ConnectorOAuthRequest' :: ConnectorOAuthRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"redirectUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
redirectUri,
(Text
"authCode" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authCode
]
)