{-# 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.AppRunner.Types.AuthenticationConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AuthenticationConfiguration = AuthenticationConfiguration'
{
AuthenticationConfiguration -> Maybe Text
accessRoleArn :: Prelude.Maybe Prelude.Text,
AuthenticationConfiguration -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text
}
deriving (AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
(AuthenticationConfiguration
-> AuthenticationConfiguration -> Bool)
-> (AuthenticationConfiguration
-> AuthenticationConfiguration -> Bool)
-> Eq AuthenticationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
$c/= :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
== :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
$c== :: AuthenticationConfiguration -> AuthenticationConfiguration -> Bool
Prelude.Eq, ReadPrec [AuthenticationConfiguration]
ReadPrec AuthenticationConfiguration
Int -> ReadS AuthenticationConfiguration
ReadS [AuthenticationConfiguration]
(Int -> ReadS AuthenticationConfiguration)
-> ReadS [AuthenticationConfiguration]
-> ReadPrec AuthenticationConfiguration
-> ReadPrec [AuthenticationConfiguration]
-> Read AuthenticationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthenticationConfiguration]
$creadListPrec :: ReadPrec [AuthenticationConfiguration]
readPrec :: ReadPrec AuthenticationConfiguration
$creadPrec :: ReadPrec AuthenticationConfiguration
readList :: ReadS [AuthenticationConfiguration]
$creadList :: ReadS [AuthenticationConfiguration]
readsPrec :: Int -> ReadS AuthenticationConfiguration
$creadsPrec :: Int -> ReadS AuthenticationConfiguration
Prelude.Read, Int -> AuthenticationConfiguration -> ShowS
[AuthenticationConfiguration] -> ShowS
AuthenticationConfiguration -> String
(Int -> AuthenticationConfiguration -> ShowS)
-> (AuthenticationConfiguration -> String)
-> ([AuthenticationConfiguration] -> ShowS)
-> Show AuthenticationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthenticationConfiguration] -> ShowS
$cshowList :: [AuthenticationConfiguration] -> ShowS
show :: AuthenticationConfiguration -> String
$cshow :: AuthenticationConfiguration -> String
showsPrec :: Int -> AuthenticationConfiguration -> ShowS
$cshowsPrec :: Int -> AuthenticationConfiguration -> ShowS
Prelude.Show, (forall x.
AuthenticationConfiguration -> Rep AuthenticationConfiguration x)
-> (forall x.
Rep AuthenticationConfiguration x -> AuthenticationConfiguration)
-> Generic AuthenticationConfiguration
forall x.
Rep AuthenticationConfiguration x -> AuthenticationConfiguration
forall x.
AuthenticationConfiguration -> Rep AuthenticationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AuthenticationConfiguration x -> AuthenticationConfiguration
$cfrom :: forall x.
AuthenticationConfiguration -> Rep AuthenticationConfiguration x
Prelude.Generic)
newAuthenticationConfiguration ::
AuthenticationConfiguration
newAuthenticationConfiguration :: AuthenticationConfiguration
newAuthenticationConfiguration =
AuthenticationConfiguration' :: Maybe Text -> Maybe Text -> AuthenticationConfiguration
AuthenticationConfiguration'
{ $sel:accessRoleArn:AuthenticationConfiguration' :: Maybe Text
accessRoleArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectionArn:AuthenticationConfiguration' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
authenticationConfiguration_accessRoleArn :: Lens.Lens' AuthenticationConfiguration (Prelude.Maybe Prelude.Text)
authenticationConfiguration_accessRoleArn :: (Maybe Text -> f (Maybe Text))
-> AuthenticationConfiguration -> f AuthenticationConfiguration
authenticationConfiguration_accessRoleArn = (AuthenticationConfiguration -> Maybe Text)
-> (AuthenticationConfiguration
-> Maybe Text -> AuthenticationConfiguration)
-> Lens
AuthenticationConfiguration
AuthenticationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationConfiguration' {Maybe Text
accessRoleArn :: Maybe Text
$sel:accessRoleArn:AuthenticationConfiguration' :: AuthenticationConfiguration -> Maybe Text
accessRoleArn} -> Maybe Text
accessRoleArn) (\s :: AuthenticationConfiguration
s@AuthenticationConfiguration' {} Maybe Text
a -> AuthenticationConfiguration
s {$sel:accessRoleArn:AuthenticationConfiguration' :: Maybe Text
accessRoleArn = Maybe Text
a} :: AuthenticationConfiguration)
authenticationConfiguration_connectionArn :: Lens.Lens' AuthenticationConfiguration (Prelude.Maybe Prelude.Text)
authenticationConfiguration_connectionArn :: (Maybe Text -> f (Maybe Text))
-> AuthenticationConfiguration -> f AuthenticationConfiguration
authenticationConfiguration_connectionArn = (AuthenticationConfiguration -> Maybe Text)
-> (AuthenticationConfiguration
-> Maybe Text -> AuthenticationConfiguration)
-> Lens
AuthenticationConfiguration
AuthenticationConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AuthenticationConfiguration' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:AuthenticationConfiguration' :: AuthenticationConfiguration -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: AuthenticationConfiguration
s@AuthenticationConfiguration' {} Maybe Text
a -> AuthenticationConfiguration
s {$sel:connectionArn:AuthenticationConfiguration' :: Maybe Text
connectionArn = Maybe Text
a} :: AuthenticationConfiguration)
instance Core.FromJSON AuthenticationConfiguration where
parseJSON :: Value -> Parser AuthenticationConfiguration
parseJSON =
String
-> (Object -> Parser AuthenticationConfiguration)
-> Value
-> Parser AuthenticationConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AuthenticationConfiguration"
( \Object
x ->
Maybe Text -> Maybe Text -> AuthenticationConfiguration
AuthenticationConfiguration'
(Maybe Text -> Maybe Text -> AuthenticationConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AuthenticationConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AccessRoleArn")
Parser (Maybe Text -> AuthenticationConfiguration)
-> Parser (Maybe Text) -> Parser AuthenticationConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConnectionArn")
)
instance Prelude.Hashable AuthenticationConfiguration
instance Prelude.NFData AuthenticationConfiguration
instance Core.ToJSON AuthenticationConfiguration where
toJSON :: AuthenticationConfiguration -> Value
toJSON AuthenticationConfiguration' {Maybe Text
connectionArn :: Maybe Text
accessRoleArn :: Maybe Text
$sel:connectionArn:AuthenticationConfiguration' :: AuthenticationConfiguration -> Maybe Text
$sel:accessRoleArn:AuthenticationConfiguration' :: AuthenticationConfiguration -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AccessRoleArn" 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
accessRoleArn,
(Text
"ConnectionArn" 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
connectionArn
]
)