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