{-# 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.CodeArtifact.Types.UpstreamRepository where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UpstreamRepository = UpstreamRepository'
{
UpstreamRepository -> Text
repositoryName :: Prelude.Text
}
deriving (UpstreamRepository -> UpstreamRepository -> Bool
(UpstreamRepository -> UpstreamRepository -> Bool)
-> (UpstreamRepository -> UpstreamRepository -> Bool)
-> Eq UpstreamRepository
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpstreamRepository -> UpstreamRepository -> Bool
$c/= :: UpstreamRepository -> UpstreamRepository -> Bool
== :: UpstreamRepository -> UpstreamRepository -> Bool
$c== :: UpstreamRepository -> UpstreamRepository -> Bool
Prelude.Eq, ReadPrec [UpstreamRepository]
ReadPrec UpstreamRepository
Int -> ReadS UpstreamRepository
ReadS [UpstreamRepository]
(Int -> ReadS UpstreamRepository)
-> ReadS [UpstreamRepository]
-> ReadPrec UpstreamRepository
-> ReadPrec [UpstreamRepository]
-> Read UpstreamRepository
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpstreamRepository]
$creadListPrec :: ReadPrec [UpstreamRepository]
readPrec :: ReadPrec UpstreamRepository
$creadPrec :: ReadPrec UpstreamRepository
readList :: ReadS [UpstreamRepository]
$creadList :: ReadS [UpstreamRepository]
readsPrec :: Int -> ReadS UpstreamRepository
$creadsPrec :: Int -> ReadS UpstreamRepository
Prelude.Read, Int -> UpstreamRepository -> ShowS
[UpstreamRepository] -> ShowS
UpstreamRepository -> String
(Int -> UpstreamRepository -> ShowS)
-> (UpstreamRepository -> String)
-> ([UpstreamRepository] -> ShowS)
-> Show UpstreamRepository
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpstreamRepository] -> ShowS
$cshowList :: [UpstreamRepository] -> ShowS
show :: UpstreamRepository -> String
$cshow :: UpstreamRepository -> String
showsPrec :: Int -> UpstreamRepository -> ShowS
$cshowsPrec :: Int -> UpstreamRepository -> ShowS
Prelude.Show, (forall x. UpstreamRepository -> Rep UpstreamRepository x)
-> (forall x. Rep UpstreamRepository x -> UpstreamRepository)
-> Generic UpstreamRepository
forall x. Rep UpstreamRepository x -> UpstreamRepository
forall x. UpstreamRepository -> Rep UpstreamRepository x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpstreamRepository x -> UpstreamRepository
$cfrom :: forall x. UpstreamRepository -> Rep UpstreamRepository x
Prelude.Generic)
newUpstreamRepository ::
Prelude.Text ->
UpstreamRepository
newUpstreamRepository :: Text -> UpstreamRepository
newUpstreamRepository Text
pRepositoryName_ =
UpstreamRepository' :: Text -> UpstreamRepository
UpstreamRepository'
{ $sel:repositoryName:UpstreamRepository' :: Text
repositoryName =
Text
pRepositoryName_
}
upstreamRepository_repositoryName :: Lens.Lens' UpstreamRepository Prelude.Text
upstreamRepository_repositoryName :: (Text -> f Text) -> UpstreamRepository -> f UpstreamRepository
upstreamRepository_repositoryName = (UpstreamRepository -> Text)
-> (UpstreamRepository -> Text -> UpstreamRepository)
-> Lens UpstreamRepository UpstreamRepository Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpstreamRepository' {Text
repositoryName :: Text
$sel:repositoryName:UpstreamRepository' :: UpstreamRepository -> Text
repositoryName} -> Text
repositoryName) (\s :: UpstreamRepository
s@UpstreamRepository' {} Text
a -> UpstreamRepository
s {$sel:repositoryName:UpstreamRepository' :: Text
repositoryName = Text
a} :: UpstreamRepository)
instance Prelude.Hashable UpstreamRepository
instance Prelude.NFData UpstreamRepository
instance Core.ToJSON UpstreamRepository where
toJSON :: UpstreamRepository -> Value
toJSON UpstreamRepository' {Text
repositoryName :: Text
$sel:repositoryName:UpstreamRepository' :: UpstreamRepository -> 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
"repositoryName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
repositoryName)
]
)