{-# 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.CodeBuild.Types.SourceCredentialsInfo where
import Amazonka.CodeBuild.Types.AuthType
import Amazonka.CodeBuild.Types.ServerType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SourceCredentialsInfo = SourceCredentialsInfo'
{
SourceCredentialsInfo -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
SourceCredentialsInfo -> Maybe ServerType
serverType :: Prelude.Maybe ServerType,
SourceCredentialsInfo -> Maybe AuthType
authType :: Prelude.Maybe AuthType
}
deriving (SourceCredentialsInfo -> SourceCredentialsInfo -> Bool
(SourceCredentialsInfo -> SourceCredentialsInfo -> Bool)
-> (SourceCredentialsInfo -> SourceCredentialsInfo -> Bool)
-> Eq SourceCredentialsInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceCredentialsInfo -> SourceCredentialsInfo -> Bool
$c/= :: SourceCredentialsInfo -> SourceCredentialsInfo -> Bool
== :: SourceCredentialsInfo -> SourceCredentialsInfo -> Bool
$c== :: SourceCredentialsInfo -> SourceCredentialsInfo -> Bool
Prelude.Eq, ReadPrec [SourceCredentialsInfo]
ReadPrec SourceCredentialsInfo
Int -> ReadS SourceCredentialsInfo
ReadS [SourceCredentialsInfo]
(Int -> ReadS SourceCredentialsInfo)
-> ReadS [SourceCredentialsInfo]
-> ReadPrec SourceCredentialsInfo
-> ReadPrec [SourceCredentialsInfo]
-> Read SourceCredentialsInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceCredentialsInfo]
$creadListPrec :: ReadPrec [SourceCredentialsInfo]
readPrec :: ReadPrec SourceCredentialsInfo
$creadPrec :: ReadPrec SourceCredentialsInfo
readList :: ReadS [SourceCredentialsInfo]
$creadList :: ReadS [SourceCredentialsInfo]
readsPrec :: Int -> ReadS SourceCredentialsInfo
$creadsPrec :: Int -> ReadS SourceCredentialsInfo
Prelude.Read, Int -> SourceCredentialsInfo -> ShowS
[SourceCredentialsInfo] -> ShowS
SourceCredentialsInfo -> String
(Int -> SourceCredentialsInfo -> ShowS)
-> (SourceCredentialsInfo -> String)
-> ([SourceCredentialsInfo] -> ShowS)
-> Show SourceCredentialsInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceCredentialsInfo] -> ShowS
$cshowList :: [SourceCredentialsInfo] -> ShowS
show :: SourceCredentialsInfo -> String
$cshow :: SourceCredentialsInfo -> String
showsPrec :: Int -> SourceCredentialsInfo -> ShowS
$cshowsPrec :: Int -> SourceCredentialsInfo -> ShowS
Prelude.Show, (forall x. SourceCredentialsInfo -> Rep SourceCredentialsInfo x)
-> (forall x. Rep SourceCredentialsInfo x -> SourceCredentialsInfo)
-> Generic SourceCredentialsInfo
forall x. Rep SourceCredentialsInfo x -> SourceCredentialsInfo
forall x. SourceCredentialsInfo -> Rep SourceCredentialsInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceCredentialsInfo x -> SourceCredentialsInfo
$cfrom :: forall x. SourceCredentialsInfo -> Rep SourceCredentialsInfo x
Prelude.Generic)
newSourceCredentialsInfo ::
SourceCredentialsInfo
newSourceCredentialsInfo :: SourceCredentialsInfo
newSourceCredentialsInfo =
SourceCredentialsInfo' :: Maybe Text
-> Maybe ServerType -> Maybe AuthType -> SourceCredentialsInfo
SourceCredentialsInfo'
{ $sel:arn:SourceCredentialsInfo' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serverType:SourceCredentialsInfo' :: Maybe ServerType
serverType = Maybe ServerType
forall a. Maybe a
Prelude.Nothing,
$sel:authType:SourceCredentialsInfo' :: Maybe AuthType
authType = Maybe AuthType
forall a. Maybe a
Prelude.Nothing
}
sourceCredentialsInfo_arn :: Lens.Lens' SourceCredentialsInfo (Prelude.Maybe Prelude.Text)
sourceCredentialsInfo_arn :: (Maybe Text -> f (Maybe Text))
-> SourceCredentialsInfo -> f SourceCredentialsInfo
sourceCredentialsInfo_arn = (SourceCredentialsInfo -> Maybe Text)
-> (SourceCredentialsInfo -> Maybe Text -> SourceCredentialsInfo)
-> Lens
SourceCredentialsInfo
SourceCredentialsInfo
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCredentialsInfo' {Maybe Text
arn :: Maybe Text
$sel:arn:SourceCredentialsInfo' :: SourceCredentialsInfo -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SourceCredentialsInfo
s@SourceCredentialsInfo' {} Maybe Text
a -> SourceCredentialsInfo
s {$sel:arn:SourceCredentialsInfo' :: Maybe Text
arn = Maybe Text
a} :: SourceCredentialsInfo)
sourceCredentialsInfo_serverType :: Lens.Lens' SourceCredentialsInfo (Prelude.Maybe ServerType)
sourceCredentialsInfo_serverType :: (Maybe ServerType -> f (Maybe ServerType))
-> SourceCredentialsInfo -> f SourceCredentialsInfo
sourceCredentialsInfo_serverType = (SourceCredentialsInfo -> Maybe ServerType)
-> (SourceCredentialsInfo
-> Maybe ServerType -> SourceCredentialsInfo)
-> Lens
SourceCredentialsInfo
SourceCredentialsInfo
(Maybe ServerType)
(Maybe ServerType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCredentialsInfo' {Maybe ServerType
serverType :: Maybe ServerType
$sel:serverType:SourceCredentialsInfo' :: SourceCredentialsInfo -> Maybe ServerType
serverType} -> Maybe ServerType
serverType) (\s :: SourceCredentialsInfo
s@SourceCredentialsInfo' {} Maybe ServerType
a -> SourceCredentialsInfo
s {$sel:serverType:SourceCredentialsInfo' :: Maybe ServerType
serverType = Maybe ServerType
a} :: SourceCredentialsInfo)
sourceCredentialsInfo_authType :: Lens.Lens' SourceCredentialsInfo (Prelude.Maybe AuthType)
sourceCredentialsInfo_authType :: (Maybe AuthType -> f (Maybe AuthType))
-> SourceCredentialsInfo -> f SourceCredentialsInfo
sourceCredentialsInfo_authType = (SourceCredentialsInfo -> Maybe AuthType)
-> (SourceCredentialsInfo
-> Maybe AuthType -> SourceCredentialsInfo)
-> Lens
SourceCredentialsInfo
SourceCredentialsInfo
(Maybe AuthType)
(Maybe AuthType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceCredentialsInfo' {Maybe AuthType
authType :: Maybe AuthType
$sel:authType:SourceCredentialsInfo' :: SourceCredentialsInfo -> Maybe AuthType
authType} -> Maybe AuthType
authType) (\s :: SourceCredentialsInfo
s@SourceCredentialsInfo' {} Maybe AuthType
a -> SourceCredentialsInfo
s {$sel:authType:SourceCredentialsInfo' :: Maybe AuthType
authType = Maybe AuthType
a} :: SourceCredentialsInfo)
instance Core.FromJSON SourceCredentialsInfo where
parseJSON :: Value -> Parser SourceCredentialsInfo
parseJSON =
String
-> (Object -> Parser SourceCredentialsInfo)
-> Value
-> Parser SourceCredentialsInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceCredentialsInfo"
( \Object
x ->
Maybe Text
-> Maybe ServerType -> Maybe AuthType -> SourceCredentialsInfo
SourceCredentialsInfo'
(Maybe Text
-> Maybe ServerType -> Maybe AuthType -> SourceCredentialsInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe ServerType -> Maybe AuthType -> SourceCredentialsInfo)
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
"arn")
Parser
(Maybe ServerType -> Maybe AuthType -> SourceCredentialsInfo)
-> Parser (Maybe ServerType)
-> Parser (Maybe AuthType -> SourceCredentialsInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServerType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serverType")
Parser (Maybe AuthType -> SourceCredentialsInfo)
-> Parser (Maybe AuthType) -> Parser SourceCredentialsInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AuthType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"authType")
)
instance Prelude.Hashable SourceCredentialsInfo
instance Prelude.NFData SourceCredentialsInfo