{-# 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.HoneycodeConnectorProfileCredentials where
import Amazonka.AppFlow.Types.ConnectorOAuthRequest
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HoneycodeConnectorProfileCredentials = HoneycodeConnectorProfileCredentials'
{
HoneycodeConnectorProfileCredentials -> Maybe (Sensitive Text)
accessToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
HoneycodeConnectorProfileCredentials -> Maybe Text
refreshToken :: Prelude.Maybe Prelude.Text,
HoneycodeConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
oAuthRequest :: Prelude.Maybe ConnectorOAuthRequest
}
deriving (HoneycodeConnectorProfileCredentials
-> HoneycodeConnectorProfileCredentials -> Bool
(HoneycodeConnectorProfileCredentials
-> HoneycodeConnectorProfileCredentials -> Bool)
-> (HoneycodeConnectorProfileCredentials
-> HoneycodeConnectorProfileCredentials -> Bool)
-> Eq HoneycodeConnectorProfileCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HoneycodeConnectorProfileCredentials
-> HoneycodeConnectorProfileCredentials -> Bool
$c/= :: HoneycodeConnectorProfileCredentials
-> HoneycodeConnectorProfileCredentials -> Bool
== :: HoneycodeConnectorProfileCredentials
-> HoneycodeConnectorProfileCredentials -> Bool
$c== :: HoneycodeConnectorProfileCredentials
-> HoneycodeConnectorProfileCredentials -> Bool
Prelude.Eq, Int -> HoneycodeConnectorProfileCredentials -> ShowS
[HoneycodeConnectorProfileCredentials] -> ShowS
HoneycodeConnectorProfileCredentials -> String
(Int -> HoneycodeConnectorProfileCredentials -> ShowS)
-> (HoneycodeConnectorProfileCredentials -> String)
-> ([HoneycodeConnectorProfileCredentials] -> ShowS)
-> Show HoneycodeConnectorProfileCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HoneycodeConnectorProfileCredentials] -> ShowS
$cshowList :: [HoneycodeConnectorProfileCredentials] -> ShowS
show :: HoneycodeConnectorProfileCredentials -> String
$cshow :: HoneycodeConnectorProfileCredentials -> String
showsPrec :: Int -> HoneycodeConnectorProfileCredentials -> ShowS
$cshowsPrec :: Int -> HoneycodeConnectorProfileCredentials -> ShowS
Prelude.Show, (forall x.
HoneycodeConnectorProfileCredentials
-> Rep HoneycodeConnectorProfileCredentials x)
-> (forall x.
Rep HoneycodeConnectorProfileCredentials x
-> HoneycodeConnectorProfileCredentials)
-> Generic HoneycodeConnectorProfileCredentials
forall x.
Rep HoneycodeConnectorProfileCredentials x
-> HoneycodeConnectorProfileCredentials
forall x.
HoneycodeConnectorProfileCredentials
-> Rep HoneycodeConnectorProfileCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HoneycodeConnectorProfileCredentials x
-> HoneycodeConnectorProfileCredentials
$cfrom :: forall x.
HoneycodeConnectorProfileCredentials
-> Rep HoneycodeConnectorProfileCredentials x
Prelude.Generic)
newHoneycodeConnectorProfileCredentials ::
HoneycodeConnectorProfileCredentials
newHoneycodeConnectorProfileCredentials :: HoneycodeConnectorProfileCredentials
newHoneycodeConnectorProfileCredentials =
HoneycodeConnectorProfileCredentials' :: Maybe (Sensitive Text)
-> Maybe Text
-> Maybe ConnectorOAuthRequest
-> HoneycodeConnectorProfileCredentials
HoneycodeConnectorProfileCredentials'
{ $sel:accessToken:HoneycodeConnectorProfileCredentials' :: Maybe (Sensitive Text)
accessToken =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:refreshToken:HoneycodeConnectorProfileCredentials' :: Maybe Text
refreshToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:oAuthRequest:HoneycodeConnectorProfileCredentials' :: Maybe ConnectorOAuthRequest
oAuthRequest = Maybe ConnectorOAuthRequest
forall a. Maybe a
Prelude.Nothing
}
honeycodeConnectorProfileCredentials_accessToken :: Lens.Lens' HoneycodeConnectorProfileCredentials (Prelude.Maybe Prelude.Text)
honeycodeConnectorProfileCredentials_accessToken :: (Maybe Text -> f (Maybe Text))
-> HoneycodeConnectorProfileCredentials
-> f HoneycodeConnectorProfileCredentials
honeycodeConnectorProfileCredentials_accessToken = (HoneycodeConnectorProfileCredentials -> Maybe (Sensitive Text))
-> (HoneycodeConnectorProfileCredentials
-> Maybe (Sensitive Text) -> HoneycodeConnectorProfileCredentials)
-> Lens
HoneycodeConnectorProfileCredentials
HoneycodeConnectorProfileCredentials
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoneycodeConnectorProfileCredentials' {Maybe (Sensitive Text)
accessToken :: Maybe (Sensitive Text)
$sel:accessToken:HoneycodeConnectorProfileCredentials' :: HoneycodeConnectorProfileCredentials -> Maybe (Sensitive Text)
accessToken} -> Maybe (Sensitive Text)
accessToken) (\s :: HoneycodeConnectorProfileCredentials
s@HoneycodeConnectorProfileCredentials' {} Maybe (Sensitive Text)
a -> HoneycodeConnectorProfileCredentials
s {$sel:accessToken:HoneycodeConnectorProfileCredentials' :: Maybe (Sensitive Text)
accessToken = Maybe (Sensitive Text)
a} :: HoneycodeConnectorProfileCredentials) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> HoneycodeConnectorProfileCredentials
-> f HoneycodeConnectorProfileCredentials)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> HoneycodeConnectorProfileCredentials
-> f HoneycodeConnectorProfileCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
honeycodeConnectorProfileCredentials_refreshToken :: Lens.Lens' HoneycodeConnectorProfileCredentials (Prelude.Maybe Prelude.Text)
honeycodeConnectorProfileCredentials_refreshToken :: (Maybe Text -> f (Maybe Text))
-> HoneycodeConnectorProfileCredentials
-> f HoneycodeConnectorProfileCredentials
honeycodeConnectorProfileCredentials_refreshToken = (HoneycodeConnectorProfileCredentials -> Maybe Text)
-> (HoneycodeConnectorProfileCredentials
-> Maybe Text -> HoneycodeConnectorProfileCredentials)
-> Lens
HoneycodeConnectorProfileCredentials
HoneycodeConnectorProfileCredentials
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoneycodeConnectorProfileCredentials' {Maybe Text
refreshToken :: Maybe Text
$sel:refreshToken:HoneycodeConnectorProfileCredentials' :: HoneycodeConnectorProfileCredentials -> Maybe Text
refreshToken} -> Maybe Text
refreshToken) (\s :: HoneycodeConnectorProfileCredentials
s@HoneycodeConnectorProfileCredentials' {} Maybe Text
a -> HoneycodeConnectorProfileCredentials
s {$sel:refreshToken:HoneycodeConnectorProfileCredentials' :: Maybe Text
refreshToken = Maybe Text
a} :: HoneycodeConnectorProfileCredentials)
honeycodeConnectorProfileCredentials_oAuthRequest :: Lens.Lens' HoneycodeConnectorProfileCredentials (Prelude.Maybe ConnectorOAuthRequest)
honeycodeConnectorProfileCredentials_oAuthRequest :: (Maybe ConnectorOAuthRequest -> f (Maybe ConnectorOAuthRequest))
-> HoneycodeConnectorProfileCredentials
-> f HoneycodeConnectorProfileCredentials
honeycodeConnectorProfileCredentials_oAuthRequest = (HoneycodeConnectorProfileCredentials
-> Maybe ConnectorOAuthRequest)
-> (HoneycodeConnectorProfileCredentials
-> Maybe ConnectorOAuthRequest
-> HoneycodeConnectorProfileCredentials)
-> Lens
HoneycodeConnectorProfileCredentials
HoneycodeConnectorProfileCredentials
(Maybe ConnectorOAuthRequest)
(Maybe ConnectorOAuthRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoneycodeConnectorProfileCredentials' {Maybe ConnectorOAuthRequest
oAuthRequest :: Maybe ConnectorOAuthRequest
$sel:oAuthRequest:HoneycodeConnectorProfileCredentials' :: HoneycodeConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
oAuthRequest} -> Maybe ConnectorOAuthRequest
oAuthRequest) (\s :: HoneycodeConnectorProfileCredentials
s@HoneycodeConnectorProfileCredentials' {} Maybe ConnectorOAuthRequest
a -> HoneycodeConnectorProfileCredentials
s {$sel:oAuthRequest:HoneycodeConnectorProfileCredentials' :: Maybe ConnectorOAuthRequest
oAuthRequest = Maybe ConnectorOAuthRequest
a} :: HoneycodeConnectorProfileCredentials)
instance
Prelude.Hashable
HoneycodeConnectorProfileCredentials
instance
Prelude.NFData
HoneycodeConnectorProfileCredentials
instance
Core.ToJSON
HoneycodeConnectorProfileCredentials
where
toJSON :: HoneycodeConnectorProfileCredentials -> Value
toJSON HoneycodeConnectorProfileCredentials' {Maybe Text
Maybe (Sensitive Text)
Maybe ConnectorOAuthRequest
oAuthRequest :: Maybe ConnectorOAuthRequest
refreshToken :: Maybe Text
accessToken :: Maybe (Sensitive Text)
$sel:oAuthRequest:HoneycodeConnectorProfileCredentials' :: HoneycodeConnectorProfileCredentials -> Maybe ConnectorOAuthRequest
$sel:refreshToken:HoneycodeConnectorProfileCredentials' :: HoneycodeConnectorProfileCredentials -> Maybe Text
$sel:accessToken:HoneycodeConnectorProfileCredentials' :: HoneycodeConnectorProfileCredentials -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"accessToken" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
accessToken,
(Text
"refreshToken" 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
refreshToken,
(Text
"oAuthRequest" Text -> ConnectorOAuthRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ConnectorOAuthRequest -> Pair)
-> Maybe ConnectorOAuthRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConnectorOAuthRequest
oAuthRequest
]
)