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