{-# 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.CodeStar.UpdateProject
(
UpdateProject (..),
newUpdateProject,
updateProject_name,
updateProject_description,
updateProject_id,
UpdateProjectResponse (..),
newUpdateProjectResponse,
updateProjectResponse_httpStatus,
)
where
import Amazonka.CodeStar.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 UpdateProject = UpdateProject'
{
UpdateProject -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
UpdateProject -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
UpdateProject -> Text
id :: Prelude.Text
}
deriving (UpdateProject -> UpdateProject -> Bool
(UpdateProject -> UpdateProject -> Bool)
-> (UpdateProject -> UpdateProject -> Bool) -> Eq UpdateProject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProject -> UpdateProject -> Bool
$c/= :: UpdateProject -> UpdateProject -> Bool
== :: UpdateProject -> UpdateProject -> Bool
$c== :: UpdateProject -> UpdateProject -> Bool
Prelude.Eq, Int -> UpdateProject -> ShowS
[UpdateProject] -> ShowS
UpdateProject -> String
(Int -> UpdateProject -> ShowS)
-> (UpdateProject -> String)
-> ([UpdateProject] -> ShowS)
-> Show UpdateProject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProject] -> ShowS
$cshowList :: [UpdateProject] -> ShowS
show :: UpdateProject -> String
$cshow :: UpdateProject -> String
showsPrec :: Int -> UpdateProject -> ShowS
$cshowsPrec :: Int -> UpdateProject -> ShowS
Prelude.Show, (forall x. UpdateProject -> Rep UpdateProject x)
-> (forall x. Rep UpdateProject x -> UpdateProject)
-> Generic UpdateProject
forall x. Rep UpdateProject x -> UpdateProject
forall x. UpdateProject -> Rep UpdateProject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateProject x -> UpdateProject
$cfrom :: forall x. UpdateProject -> Rep UpdateProject x
Prelude.Generic)
newUpdateProject ::
Prelude.Text ->
UpdateProject
newUpdateProject :: Text -> UpdateProject
newUpdateProject Text
pId_ =
UpdateProject' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> Text -> UpdateProject
UpdateProject'
{ $sel:name:UpdateProject' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateProject' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:id:UpdateProject' :: Text
id = Text
pId_
}
updateProject_name :: Lens.Lens' UpdateProject (Prelude.Maybe Prelude.Text)
updateProject_name :: (Maybe Text -> f (Maybe Text)) -> UpdateProject -> f UpdateProject
updateProject_name = (UpdateProject -> Maybe (Sensitive Text))
-> (UpdateProject -> Maybe (Sensitive Text) -> UpdateProject)
-> Lens
UpdateProject
UpdateProject
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProject' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:UpdateProject' :: UpdateProject -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: UpdateProject
s@UpdateProject' {} Maybe (Sensitive Text)
a -> UpdateProject
s {$sel:name:UpdateProject' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: UpdateProject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> UpdateProject -> f UpdateProject)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateProject
-> f UpdateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
updateProject_description :: Lens.Lens' UpdateProject (Prelude.Maybe Prelude.Text)
updateProject_description :: (Maybe Text -> f (Maybe Text)) -> UpdateProject -> f UpdateProject
updateProject_description = (UpdateProject -> Maybe (Sensitive Text))
-> (UpdateProject -> Maybe (Sensitive Text) -> UpdateProject)
-> Lens
UpdateProject
UpdateProject
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProject' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateProject' :: UpdateProject -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateProject
s@UpdateProject' {} Maybe (Sensitive Text)
a -> UpdateProject
s {$sel:description:UpdateProject' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateProject) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> UpdateProject -> f UpdateProject)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateProject
-> f UpdateProject
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
updateProject_id :: Lens.Lens' UpdateProject Prelude.Text
updateProject_id :: (Text -> f Text) -> UpdateProject -> f UpdateProject
updateProject_id = (UpdateProject -> Text)
-> (UpdateProject -> Text -> UpdateProject)
-> Lens UpdateProject UpdateProject Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProject' {Text
id :: Text
$sel:id:UpdateProject' :: UpdateProject -> Text
id} -> Text
id) (\s :: UpdateProject
s@UpdateProject' {} Text
a -> UpdateProject
s {$sel:id:UpdateProject' :: Text
id = Text
a} :: UpdateProject)
instance Core.AWSRequest UpdateProject where
type
AWSResponse UpdateProject =
UpdateProjectResponse
request :: UpdateProject -> Request UpdateProject
request = Service -> UpdateProject -> Request UpdateProject
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateProject)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateProject))
-> Logger
-> Service
-> Proxy UpdateProject
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateProject)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateProjectResponse
UpdateProjectResponse'
(Int -> UpdateProjectResponse)
-> Either String Int -> Either String UpdateProjectResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateProject
instance Prelude.NFData UpdateProject
instance Core.ToHeaders UpdateProject where
toHeaders :: UpdateProject -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateProject -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CodeStar_20170419.UpdateProject" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateProject where
toJSON :: UpdateProject -> Value
toJSON UpdateProject' {Maybe (Sensitive Text)
Text
id :: Text
description :: Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:id:UpdateProject' :: UpdateProject -> Text
$sel:description:UpdateProject' :: UpdateProject -> Maybe (Sensitive Text)
$sel:name:UpdateProject' :: UpdateProject -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"name" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
name,
(Text
"description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)
]
)
instance Core.ToPath UpdateProject where
toPath :: UpdateProject -> ByteString
toPath = ByteString -> UpdateProject -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateProject where
toQuery :: UpdateProject -> QueryString
toQuery = QueryString -> UpdateProject -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateProjectResponse = UpdateProjectResponse'
{
UpdateProjectResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateProjectResponse -> UpdateProjectResponse -> Bool
(UpdateProjectResponse -> UpdateProjectResponse -> Bool)
-> (UpdateProjectResponse -> UpdateProjectResponse -> Bool)
-> Eq UpdateProjectResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProjectResponse -> UpdateProjectResponse -> Bool
$c/= :: UpdateProjectResponse -> UpdateProjectResponse -> Bool
== :: UpdateProjectResponse -> UpdateProjectResponse -> Bool
$c== :: UpdateProjectResponse -> UpdateProjectResponse -> Bool
Prelude.Eq, ReadPrec [UpdateProjectResponse]
ReadPrec UpdateProjectResponse
Int -> ReadS UpdateProjectResponse
ReadS [UpdateProjectResponse]
(Int -> ReadS UpdateProjectResponse)
-> ReadS [UpdateProjectResponse]
-> ReadPrec UpdateProjectResponse
-> ReadPrec [UpdateProjectResponse]
-> Read UpdateProjectResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProjectResponse]
$creadListPrec :: ReadPrec [UpdateProjectResponse]
readPrec :: ReadPrec UpdateProjectResponse
$creadPrec :: ReadPrec UpdateProjectResponse
readList :: ReadS [UpdateProjectResponse]
$creadList :: ReadS [UpdateProjectResponse]
readsPrec :: Int -> ReadS UpdateProjectResponse
$creadsPrec :: Int -> ReadS UpdateProjectResponse
Prelude.Read, Int -> UpdateProjectResponse -> ShowS
[UpdateProjectResponse] -> ShowS
UpdateProjectResponse -> String
(Int -> UpdateProjectResponse -> ShowS)
-> (UpdateProjectResponse -> String)
-> ([UpdateProjectResponse] -> ShowS)
-> Show UpdateProjectResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProjectResponse] -> ShowS
$cshowList :: [UpdateProjectResponse] -> ShowS
show :: UpdateProjectResponse -> String
$cshow :: UpdateProjectResponse -> String
showsPrec :: Int -> UpdateProjectResponse -> ShowS
$cshowsPrec :: Int -> UpdateProjectResponse -> ShowS
Prelude.Show, (forall x. UpdateProjectResponse -> Rep UpdateProjectResponse x)
-> (forall x. Rep UpdateProjectResponse x -> UpdateProjectResponse)
-> Generic UpdateProjectResponse
forall x. Rep UpdateProjectResponse x -> UpdateProjectResponse
forall x. UpdateProjectResponse -> Rep UpdateProjectResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateProjectResponse x -> UpdateProjectResponse
$cfrom :: forall x. UpdateProjectResponse -> Rep UpdateProjectResponse x
Prelude.Generic)
newUpdateProjectResponse ::
Prelude.Int ->
UpdateProjectResponse
newUpdateProjectResponse :: Int -> UpdateProjectResponse
newUpdateProjectResponse Int
pHttpStatus_ =
UpdateProjectResponse' :: Int -> UpdateProjectResponse
UpdateProjectResponse' {$sel:httpStatus:UpdateProjectResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateProjectResponse_httpStatus :: Lens.Lens' UpdateProjectResponse Prelude.Int
updateProjectResponse_httpStatus :: (Int -> f Int) -> UpdateProjectResponse -> f UpdateProjectResponse
updateProjectResponse_httpStatus = (UpdateProjectResponse -> Int)
-> (UpdateProjectResponse -> Int -> UpdateProjectResponse)
-> Lens UpdateProjectResponse UpdateProjectResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProjectResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateProjectResponse' :: UpdateProjectResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateProjectResponse
s@UpdateProjectResponse' {} Int
a -> UpdateProjectResponse
s {$sel:httpStatus:UpdateProjectResponse' :: Int
httpStatus = Int
a} :: UpdateProjectResponse)
instance Prelude.NFData UpdateProjectResponse