{-# 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.SlackConnectorProfileCredentials where
import Amazonka.AppFlow.Types.ConnectorOAuthRequest
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 SlackConnectorProfileCredentials = SlackConnectorProfileCredentials'
{
SlackConnectorProfileCredentials -> Maybe (Sensitive Text)
accessToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
SlackConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
oAuthRequest :: Prelude.Maybe ConnectorOAuthRequest,
SlackConnectorProfileCredentials -> Text
clientId :: Prelude.Text,
SlackConnectorProfileCredentials -> Sensitive Text
clientSecret :: Data.Sensitive Prelude.Text
}
deriving (SlackConnectorProfileCredentials
-> SlackConnectorProfileCredentials -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlackConnectorProfileCredentials
-> SlackConnectorProfileCredentials -> Bool
$c/= :: SlackConnectorProfileCredentials
-> SlackConnectorProfileCredentials -> Bool
== :: SlackConnectorProfileCredentials
-> SlackConnectorProfileCredentials -> Bool
$c== :: SlackConnectorProfileCredentials
-> SlackConnectorProfileCredentials -> Bool
Prelude.Eq, Int -> SlackConnectorProfileCredentials -> ShowS
[SlackConnectorProfileCredentials] -> ShowS
SlackConnectorProfileCredentials -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlackConnectorProfileCredentials] -> ShowS
$cshowList :: [SlackConnectorProfileCredentials] -> ShowS
show :: SlackConnectorProfileCredentials -> String
$cshow :: SlackConnectorProfileCredentials -> String
showsPrec :: Int -> SlackConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> SlackConnectorProfileCredentials -> ShowS
Prelude.Show, forall x.
Rep SlackConnectorProfileCredentials x
-> SlackConnectorProfileCredentials
forall x.
SlackConnectorProfileCredentials
-> Rep SlackConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SlackConnectorProfileCredentials x
-> SlackConnectorProfileCredentials
$cfrom :: forall x.
SlackConnectorProfileCredentials
-> Rep SlackConnectorProfileCredentials x
Prelude.Generic)
newSlackConnectorProfileCredentials ::
Prelude.Text ->
Prelude.Text ->
SlackConnectorProfileCredentials
newSlackConnectorProfileCredentials :: Text -> Text -> SlackConnectorProfileCredentials
newSlackConnectorProfileCredentials
Text
pClientId_
Text
pClientSecret_ =
SlackConnectorProfileCredentials'
{ $sel:accessToken:SlackConnectorProfileCredentials' :: Maybe (Sensitive Text)
accessToken =
forall a. Maybe a
Prelude.Nothing,
$sel:oAuthRequest:SlackConnectorProfileCredentials' :: Maybe ConnectorOAuthRequest
oAuthRequest = forall a. Maybe a
Prelude.Nothing,
$sel:clientId:SlackConnectorProfileCredentials' :: Text
clientId = Text
pClientId_,
$sel:clientSecret:SlackConnectorProfileCredentials' :: Sensitive Text
clientSecret =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pClientSecret_
}
slackConnectorProfileCredentials_accessToken :: Lens.Lens' SlackConnectorProfileCredentials (Prelude.Maybe Prelude.Text)
slackConnectorProfileCredentials_accessToken :: Lens' SlackConnectorProfileCredentials (Maybe Text)
slackConnectorProfileCredentials_accessToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConnectorProfileCredentials' {Maybe (Sensitive Text)
accessToken :: Maybe (Sensitive Text)
$sel:accessToken:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe (Sensitive Text)
accessToken} -> Maybe (Sensitive Text)
accessToken) (\s :: SlackConnectorProfileCredentials
s@SlackConnectorProfileCredentials' {} Maybe (Sensitive Text)
a -> SlackConnectorProfileCredentials
s {$sel:accessToken:SlackConnectorProfileCredentials' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
a} :: SlackConnectorProfileCredentials) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
slackConnectorProfileCredentials_oAuthRequest :: Lens.Lens' SlackConnectorProfileCredentials (Prelude.Maybe ConnectorOAuthRequest)
slackConnectorProfileCredentials_oAuthRequest :: Lens'
SlackConnectorProfileCredentials (Maybe ConnectorOAuthRequest)
slackConnectorProfileCredentials_oAuthRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConnectorProfileCredentials' {Maybe ConnectorOAuthRequest
oAuthRequest :: Maybe ConnectorOAuthRequest
$sel:oAuthRequest:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
oAuthRequest} -> Maybe ConnectorOAuthRequest
oAuthRequest) (\s :: SlackConnectorProfileCredentials
s@SlackConnectorProfileCredentials' {} Maybe ConnectorOAuthRequest
a -> SlackConnectorProfileCredentials
s {$sel:oAuthRequest:SlackConnectorProfileCredentials' :: Maybe ConnectorOAuthRequest
oAuthRequest = Maybe ConnectorOAuthRequest
a} :: SlackConnectorProfileCredentials)
slackConnectorProfileCredentials_clientId :: Lens.Lens' SlackConnectorProfileCredentials Prelude.Text
slackConnectorProfileCredentials_clientId :: Lens' SlackConnectorProfileCredentials Text
slackConnectorProfileCredentials_clientId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConnectorProfileCredentials' {Text
clientId :: Text
$sel:clientId:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Text
clientId} -> Text
clientId) (\s :: SlackConnectorProfileCredentials
s@SlackConnectorProfileCredentials' {} Text
a -> SlackConnectorProfileCredentials
s {$sel:clientId:SlackConnectorProfileCredentials' :: Text
clientId = Text
a} :: SlackConnectorProfileCredentials)
slackConnectorProfileCredentials_clientSecret :: Lens.Lens' SlackConnectorProfileCredentials Prelude.Text
slackConnectorProfileCredentials_clientSecret :: Lens' SlackConnectorProfileCredentials Text
slackConnectorProfileCredentials_clientSecret = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlackConnectorProfileCredentials' {Sensitive Text
clientSecret :: Sensitive Text
$sel:clientSecret:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Sensitive Text
clientSecret} -> Sensitive Text
clientSecret) (\s :: SlackConnectorProfileCredentials
s@SlackConnectorProfileCredentials' {} Sensitive Text
a -> SlackConnectorProfileCredentials
s {$sel:clientSecret:SlackConnectorProfileCredentials' :: Sensitive Text
clientSecret = Sensitive Text
a} :: SlackConnectorProfileCredentials) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance
Prelude.Hashable
SlackConnectorProfileCredentials
where
hashWithSalt :: Int -> SlackConnectorProfileCredentials -> Int
hashWithSalt
Int
_salt
SlackConnectorProfileCredentials' {Maybe (Sensitive Text)
Maybe ConnectorOAuthRequest
Text
Sensitive Text
clientSecret :: Sensitive Text
clientId :: Text
oAuthRequest :: Maybe ConnectorOAuthRequest
accessToken :: Maybe (Sensitive Text)
$sel:clientSecret:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Sensitive Text
$sel:clientId:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Text
$sel:oAuthRequest:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
$sel:accessToken:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
accessToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConnectorOAuthRequest
oAuthRequest
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
clientSecret
instance
Prelude.NFData
SlackConnectorProfileCredentials
where
rnf :: SlackConnectorProfileCredentials -> ()
rnf SlackConnectorProfileCredentials' {Maybe (Sensitive Text)
Maybe ConnectorOAuthRequest
Text
Sensitive Text
clientSecret :: Sensitive Text
clientId :: Text
oAuthRequest :: Maybe ConnectorOAuthRequest
accessToken :: Maybe (Sensitive Text)
$sel:clientSecret:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Sensitive Text
$sel:clientId:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Text
$sel:oAuthRequest:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
$sel:accessToken:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
accessToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectorOAuthRequest
oAuthRequest
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
clientSecret
instance Data.ToJSON SlackConnectorProfileCredentials where
toJSON :: SlackConnectorProfileCredentials -> Value
toJSON SlackConnectorProfileCredentials' {Maybe (Sensitive Text)
Maybe ConnectorOAuthRequest
Text
Sensitive Text
clientSecret :: Sensitive Text
clientId :: Text
oAuthRequest :: Maybe ConnectorOAuthRequest
accessToken :: Maybe (Sensitive Text)
$sel:clientSecret:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Sensitive Text
$sel:clientId:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Text
$sel:oAuthRequest:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
$sel:accessToken:SlackConnectorProfileCredentials' :: SlackConnectorProfileCredentials -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"accessToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
accessToken,
(Key
"oAuthRequest" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectorOAuthRequest
oAuthRequest,
forall a. a -> Maybe a
Prelude.Just (Key
"clientId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientId),
forall a. a -> Maybe a
Prelude.Just (Key
"clientSecret" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
clientSecret)
]
)