{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CodeCommit.UpdateRepositoryDescription
(
UpdateRepositoryDescription (..),
newUpdateRepositoryDescription,
updateRepositoryDescription_repositoryDescription,
updateRepositoryDescription_repositoryName,
UpdateRepositoryDescriptionResponse (..),
newUpdateRepositoryDescriptionResponse,
)
where
import Amazonka.CodeCommit.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateRepositoryDescription = UpdateRepositoryDescription'
{
UpdateRepositoryDescription -> Maybe Text
repositoryDescription :: Prelude.Maybe Prelude.Text,
UpdateRepositoryDescription -> Text
repositoryName :: Prelude.Text
}
deriving (UpdateRepositoryDescription -> UpdateRepositoryDescription -> Bool
(UpdateRepositoryDescription
-> UpdateRepositoryDescription -> Bool)
-> (UpdateRepositoryDescription
-> UpdateRepositoryDescription -> Bool)
-> Eq UpdateRepositoryDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRepositoryDescription -> UpdateRepositoryDescription -> Bool
$c/= :: UpdateRepositoryDescription -> UpdateRepositoryDescription -> Bool
== :: UpdateRepositoryDescription -> UpdateRepositoryDescription -> Bool
$c== :: UpdateRepositoryDescription -> UpdateRepositoryDescription -> Bool
Prelude.Eq, ReadPrec [UpdateRepositoryDescription]
ReadPrec UpdateRepositoryDescription
Int -> ReadS UpdateRepositoryDescription
ReadS [UpdateRepositoryDescription]
(Int -> ReadS UpdateRepositoryDescription)
-> ReadS [UpdateRepositoryDescription]
-> ReadPrec UpdateRepositoryDescription
-> ReadPrec [UpdateRepositoryDescription]
-> Read UpdateRepositoryDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRepositoryDescription]
$creadListPrec :: ReadPrec [UpdateRepositoryDescription]
readPrec :: ReadPrec UpdateRepositoryDescription
$creadPrec :: ReadPrec UpdateRepositoryDescription
readList :: ReadS [UpdateRepositoryDescription]
$creadList :: ReadS [UpdateRepositoryDescription]
readsPrec :: Int -> ReadS UpdateRepositoryDescription
$creadsPrec :: Int -> ReadS UpdateRepositoryDescription
Prelude.Read, Int -> UpdateRepositoryDescription -> ShowS
[UpdateRepositoryDescription] -> ShowS
UpdateRepositoryDescription -> String
(Int -> UpdateRepositoryDescription -> ShowS)
-> (UpdateRepositoryDescription -> String)
-> ([UpdateRepositoryDescription] -> ShowS)
-> Show UpdateRepositoryDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRepositoryDescription] -> ShowS
$cshowList :: [UpdateRepositoryDescription] -> ShowS
show :: UpdateRepositoryDescription -> String
$cshow :: UpdateRepositoryDescription -> String
showsPrec :: Int -> UpdateRepositoryDescription -> ShowS
$cshowsPrec :: Int -> UpdateRepositoryDescription -> ShowS
Prelude.Show, (forall x.
UpdateRepositoryDescription -> Rep UpdateRepositoryDescription x)
-> (forall x.
Rep UpdateRepositoryDescription x -> UpdateRepositoryDescription)
-> Generic UpdateRepositoryDescription
forall x.
Rep UpdateRepositoryDescription x -> UpdateRepositoryDescription
forall x.
UpdateRepositoryDescription -> Rep UpdateRepositoryDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRepositoryDescription x -> UpdateRepositoryDescription
$cfrom :: forall x.
UpdateRepositoryDescription -> Rep UpdateRepositoryDescription x
Prelude.Generic)
newUpdateRepositoryDescription ::
Prelude.Text ->
UpdateRepositoryDescription
newUpdateRepositoryDescription :: Text -> UpdateRepositoryDescription
newUpdateRepositoryDescription Text
pRepositoryName_ =
UpdateRepositoryDescription' :: Maybe Text -> Text -> UpdateRepositoryDescription
UpdateRepositoryDescription'
{ $sel:repositoryDescription:UpdateRepositoryDescription' :: Maybe Text
repositoryDescription =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:repositoryName:UpdateRepositoryDescription' :: Text
repositoryName = Text
pRepositoryName_
}
updateRepositoryDescription_repositoryDescription :: Lens.Lens' UpdateRepositoryDescription (Prelude.Maybe Prelude.Text)
updateRepositoryDescription_repositoryDescription :: (Maybe Text -> f (Maybe Text))
-> UpdateRepositoryDescription -> f UpdateRepositoryDescription
updateRepositoryDescription_repositoryDescription = (UpdateRepositoryDescription -> Maybe Text)
-> (UpdateRepositoryDescription
-> Maybe Text -> UpdateRepositoryDescription)
-> Lens
UpdateRepositoryDescription
UpdateRepositoryDescription
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRepositoryDescription' {Maybe Text
repositoryDescription :: Maybe Text
$sel:repositoryDescription:UpdateRepositoryDescription' :: UpdateRepositoryDescription -> Maybe Text
repositoryDescription} -> Maybe Text
repositoryDescription) (\s :: UpdateRepositoryDescription
s@UpdateRepositoryDescription' {} Maybe Text
a -> UpdateRepositoryDescription
s {$sel:repositoryDescription:UpdateRepositoryDescription' :: Maybe Text
repositoryDescription = Maybe Text
a} :: UpdateRepositoryDescription)
updateRepositoryDescription_repositoryName :: Lens.Lens' UpdateRepositoryDescription Prelude.Text
updateRepositoryDescription_repositoryName :: (Text -> f Text)
-> UpdateRepositoryDescription -> f UpdateRepositoryDescription
updateRepositoryDescription_repositoryName = (UpdateRepositoryDescription -> Text)
-> (UpdateRepositoryDescription
-> Text -> UpdateRepositoryDescription)
-> Lens
UpdateRepositoryDescription UpdateRepositoryDescription Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRepositoryDescription' {Text
repositoryName :: Text
$sel:repositoryName:UpdateRepositoryDescription' :: UpdateRepositoryDescription -> Text
repositoryName} -> Text
repositoryName) (\s :: UpdateRepositoryDescription
s@UpdateRepositoryDescription' {} Text
a -> UpdateRepositoryDescription
s {$sel:repositoryName:UpdateRepositoryDescription' :: Text
repositoryName = Text
a} :: UpdateRepositoryDescription)
instance Core.AWSRequest UpdateRepositoryDescription where
type
AWSResponse UpdateRepositoryDescription =
UpdateRepositoryDescriptionResponse
request :: UpdateRepositoryDescription -> Request UpdateRepositoryDescription
request = Service
-> UpdateRepositoryDescription
-> Request UpdateRepositoryDescription
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRepositoryDescription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRepositoryDescription)))
response =
AWSResponse UpdateRepositoryDescription
-> Logger
-> Service
-> Proxy UpdateRepositoryDescription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateRepositoryDescription)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse UpdateRepositoryDescription
UpdateRepositoryDescriptionResponse
UpdateRepositoryDescriptionResponse'
instance Prelude.Hashable UpdateRepositoryDescription
instance Prelude.NFData UpdateRepositoryDescription
instance Core.ToHeaders UpdateRepositoryDescription where
toHeaders :: UpdateRepositoryDescription -> [Header]
toHeaders =
[Header] -> UpdateRepositoryDescription -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"CodeCommit_20150413.UpdateRepositoryDescription" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateRepositoryDescription where
toJSON :: UpdateRepositoryDescription -> Value
toJSON UpdateRepositoryDescription' {Maybe Text
Text
repositoryName :: Text
repositoryDescription :: Maybe Text
$sel:repositoryName:UpdateRepositoryDescription' :: UpdateRepositoryDescription -> Text
$sel:repositoryDescription:UpdateRepositoryDescription' :: UpdateRepositoryDescription -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"repositoryDescription" 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
repositoryDescription,
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)
]
)
instance Core.ToPath UpdateRepositoryDescription where
toPath :: UpdateRepositoryDescription -> ByteString
toPath = ByteString -> UpdateRepositoryDescription -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateRepositoryDescription where
toQuery :: UpdateRepositoryDescription -> QueryString
toQuery = QueryString -> UpdateRepositoryDescription -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRepositoryDescriptionResponse = UpdateRepositoryDescriptionResponse'
{
}
deriving (UpdateRepositoryDescriptionResponse
-> UpdateRepositoryDescriptionResponse -> Bool
(UpdateRepositoryDescriptionResponse
-> UpdateRepositoryDescriptionResponse -> Bool)
-> (UpdateRepositoryDescriptionResponse
-> UpdateRepositoryDescriptionResponse -> Bool)
-> Eq UpdateRepositoryDescriptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRepositoryDescriptionResponse
-> UpdateRepositoryDescriptionResponse -> Bool
$c/= :: UpdateRepositoryDescriptionResponse
-> UpdateRepositoryDescriptionResponse -> Bool
== :: UpdateRepositoryDescriptionResponse
-> UpdateRepositoryDescriptionResponse -> Bool
$c== :: UpdateRepositoryDescriptionResponse
-> UpdateRepositoryDescriptionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRepositoryDescriptionResponse]
ReadPrec UpdateRepositoryDescriptionResponse
Int -> ReadS UpdateRepositoryDescriptionResponse
ReadS [UpdateRepositoryDescriptionResponse]
(Int -> ReadS UpdateRepositoryDescriptionResponse)
-> ReadS [UpdateRepositoryDescriptionResponse]
-> ReadPrec UpdateRepositoryDescriptionResponse
-> ReadPrec [UpdateRepositoryDescriptionResponse]
-> Read UpdateRepositoryDescriptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRepositoryDescriptionResponse]
$creadListPrec :: ReadPrec [UpdateRepositoryDescriptionResponse]
readPrec :: ReadPrec UpdateRepositoryDescriptionResponse
$creadPrec :: ReadPrec UpdateRepositoryDescriptionResponse
readList :: ReadS [UpdateRepositoryDescriptionResponse]
$creadList :: ReadS [UpdateRepositoryDescriptionResponse]
readsPrec :: Int -> ReadS UpdateRepositoryDescriptionResponse
$creadsPrec :: Int -> ReadS UpdateRepositoryDescriptionResponse
Prelude.Read, Int -> UpdateRepositoryDescriptionResponse -> ShowS
[UpdateRepositoryDescriptionResponse] -> ShowS
UpdateRepositoryDescriptionResponse -> String
(Int -> UpdateRepositoryDescriptionResponse -> ShowS)
-> (UpdateRepositoryDescriptionResponse -> String)
-> ([UpdateRepositoryDescriptionResponse] -> ShowS)
-> Show UpdateRepositoryDescriptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRepositoryDescriptionResponse] -> ShowS
$cshowList :: [UpdateRepositoryDescriptionResponse] -> ShowS
show :: UpdateRepositoryDescriptionResponse -> String
$cshow :: UpdateRepositoryDescriptionResponse -> String
showsPrec :: Int -> UpdateRepositoryDescriptionResponse -> ShowS
$cshowsPrec :: Int -> UpdateRepositoryDescriptionResponse -> ShowS
Prelude.Show, (forall x.
UpdateRepositoryDescriptionResponse
-> Rep UpdateRepositoryDescriptionResponse x)
-> (forall x.
Rep UpdateRepositoryDescriptionResponse x
-> UpdateRepositoryDescriptionResponse)
-> Generic UpdateRepositoryDescriptionResponse
forall x.
Rep UpdateRepositoryDescriptionResponse x
-> UpdateRepositoryDescriptionResponse
forall x.
UpdateRepositoryDescriptionResponse
-> Rep UpdateRepositoryDescriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRepositoryDescriptionResponse x
-> UpdateRepositoryDescriptionResponse
$cfrom :: forall x.
UpdateRepositoryDescriptionResponse
-> Rep UpdateRepositoryDescriptionResponse x
Prelude.Generic)
newUpdateRepositoryDescriptionResponse ::
UpdateRepositoryDescriptionResponse
newUpdateRepositoryDescriptionResponse :: UpdateRepositoryDescriptionResponse
newUpdateRepositoryDescriptionResponse =
UpdateRepositoryDescriptionResponse
UpdateRepositoryDescriptionResponse'
instance
Prelude.NFData
UpdateRepositoryDescriptionResponse