{-# 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.CodeBuild.StopBuildBatch
(
StopBuildBatch (..),
newStopBuildBatch,
stopBuildBatch_id,
StopBuildBatchResponse (..),
newStopBuildBatchResponse,
stopBuildBatchResponse_buildBatch,
stopBuildBatchResponse_httpStatus,
)
where
import Amazonka.CodeBuild.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 StopBuildBatch = StopBuildBatch'
{
StopBuildBatch -> Text
id :: Prelude.Text
}
deriving (StopBuildBatch -> StopBuildBatch -> Bool
(StopBuildBatch -> StopBuildBatch -> Bool)
-> (StopBuildBatch -> StopBuildBatch -> Bool) -> Eq StopBuildBatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopBuildBatch -> StopBuildBatch -> Bool
$c/= :: StopBuildBatch -> StopBuildBatch -> Bool
== :: StopBuildBatch -> StopBuildBatch -> Bool
$c== :: StopBuildBatch -> StopBuildBatch -> Bool
Prelude.Eq, ReadPrec [StopBuildBatch]
ReadPrec StopBuildBatch
Int -> ReadS StopBuildBatch
ReadS [StopBuildBatch]
(Int -> ReadS StopBuildBatch)
-> ReadS [StopBuildBatch]
-> ReadPrec StopBuildBatch
-> ReadPrec [StopBuildBatch]
-> Read StopBuildBatch
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopBuildBatch]
$creadListPrec :: ReadPrec [StopBuildBatch]
readPrec :: ReadPrec StopBuildBatch
$creadPrec :: ReadPrec StopBuildBatch
readList :: ReadS [StopBuildBatch]
$creadList :: ReadS [StopBuildBatch]
readsPrec :: Int -> ReadS StopBuildBatch
$creadsPrec :: Int -> ReadS StopBuildBatch
Prelude.Read, Int -> StopBuildBatch -> ShowS
[StopBuildBatch] -> ShowS
StopBuildBatch -> String
(Int -> StopBuildBatch -> ShowS)
-> (StopBuildBatch -> String)
-> ([StopBuildBatch] -> ShowS)
-> Show StopBuildBatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopBuildBatch] -> ShowS
$cshowList :: [StopBuildBatch] -> ShowS
show :: StopBuildBatch -> String
$cshow :: StopBuildBatch -> String
showsPrec :: Int -> StopBuildBatch -> ShowS
$cshowsPrec :: Int -> StopBuildBatch -> ShowS
Prelude.Show, (forall x. StopBuildBatch -> Rep StopBuildBatch x)
-> (forall x. Rep StopBuildBatch x -> StopBuildBatch)
-> Generic StopBuildBatch
forall x. Rep StopBuildBatch x -> StopBuildBatch
forall x. StopBuildBatch -> Rep StopBuildBatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopBuildBatch x -> StopBuildBatch
$cfrom :: forall x. StopBuildBatch -> Rep StopBuildBatch x
Prelude.Generic)
newStopBuildBatch ::
Prelude.Text ->
StopBuildBatch
newStopBuildBatch :: Text -> StopBuildBatch
newStopBuildBatch Text
pId_ = StopBuildBatch' :: Text -> StopBuildBatch
StopBuildBatch' {$sel:id:StopBuildBatch' :: Text
id = Text
pId_}
stopBuildBatch_id :: Lens.Lens' StopBuildBatch Prelude.Text
stopBuildBatch_id :: (Text -> f Text) -> StopBuildBatch -> f StopBuildBatch
stopBuildBatch_id = (StopBuildBatch -> Text)
-> (StopBuildBatch -> Text -> StopBuildBatch)
-> Lens StopBuildBatch StopBuildBatch Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopBuildBatch' {Text
id :: Text
$sel:id:StopBuildBatch' :: StopBuildBatch -> Text
id} -> Text
id) (\s :: StopBuildBatch
s@StopBuildBatch' {} Text
a -> StopBuildBatch
s {$sel:id:StopBuildBatch' :: Text
id = Text
a} :: StopBuildBatch)
instance Core.AWSRequest StopBuildBatch where
type
AWSResponse StopBuildBatch =
StopBuildBatchResponse
request :: StopBuildBatch -> Request StopBuildBatch
request = Service -> StopBuildBatch -> Request StopBuildBatch
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopBuildBatch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopBuildBatch)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopBuildBatch))
-> Logger
-> Service
-> Proxy StopBuildBatch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopBuildBatch)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe BuildBatch -> Int -> StopBuildBatchResponse
StopBuildBatchResponse'
(Maybe BuildBatch -> Int -> StopBuildBatchResponse)
-> Either String (Maybe BuildBatch)
-> Either String (Int -> StopBuildBatchResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe BuildBatch)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"buildBatch")
Either String (Int -> StopBuildBatchResponse)
-> Either String Int -> Either String StopBuildBatchResponse
forall (f :: * -> *) a b. Applicative f => 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 StopBuildBatch
instance Prelude.NFData StopBuildBatch
instance Core.ToHeaders StopBuildBatch where
toHeaders :: StopBuildBatch -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopBuildBatch -> 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
"CodeBuild_20161006.StopBuildBatch" ::
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 StopBuildBatch where
toJSON :: StopBuildBatch -> Value
toJSON StopBuildBatch' {Text
id :: Text
$sel:id:StopBuildBatch' :: StopBuildBatch -> 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
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
id)])
instance Core.ToPath StopBuildBatch where
toPath :: StopBuildBatch -> ByteString
toPath = ByteString -> StopBuildBatch -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopBuildBatch where
toQuery :: StopBuildBatch -> QueryString
toQuery = QueryString -> StopBuildBatch -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopBuildBatchResponse = StopBuildBatchResponse'
{ StopBuildBatchResponse -> Maybe BuildBatch
buildBatch :: Prelude.Maybe BuildBatch,
StopBuildBatchResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopBuildBatchResponse -> StopBuildBatchResponse -> Bool
(StopBuildBatchResponse -> StopBuildBatchResponse -> Bool)
-> (StopBuildBatchResponse -> StopBuildBatchResponse -> Bool)
-> Eq StopBuildBatchResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopBuildBatchResponse -> StopBuildBatchResponse -> Bool
$c/= :: StopBuildBatchResponse -> StopBuildBatchResponse -> Bool
== :: StopBuildBatchResponse -> StopBuildBatchResponse -> Bool
$c== :: StopBuildBatchResponse -> StopBuildBatchResponse -> Bool
Prelude.Eq, ReadPrec [StopBuildBatchResponse]
ReadPrec StopBuildBatchResponse
Int -> ReadS StopBuildBatchResponse
ReadS [StopBuildBatchResponse]
(Int -> ReadS StopBuildBatchResponse)
-> ReadS [StopBuildBatchResponse]
-> ReadPrec StopBuildBatchResponse
-> ReadPrec [StopBuildBatchResponse]
-> Read StopBuildBatchResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopBuildBatchResponse]
$creadListPrec :: ReadPrec [StopBuildBatchResponse]
readPrec :: ReadPrec StopBuildBatchResponse
$creadPrec :: ReadPrec StopBuildBatchResponse
readList :: ReadS [StopBuildBatchResponse]
$creadList :: ReadS [StopBuildBatchResponse]
readsPrec :: Int -> ReadS StopBuildBatchResponse
$creadsPrec :: Int -> ReadS StopBuildBatchResponse
Prelude.Read, Int -> StopBuildBatchResponse -> ShowS
[StopBuildBatchResponse] -> ShowS
StopBuildBatchResponse -> String
(Int -> StopBuildBatchResponse -> ShowS)
-> (StopBuildBatchResponse -> String)
-> ([StopBuildBatchResponse] -> ShowS)
-> Show StopBuildBatchResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopBuildBatchResponse] -> ShowS
$cshowList :: [StopBuildBatchResponse] -> ShowS
show :: StopBuildBatchResponse -> String
$cshow :: StopBuildBatchResponse -> String
showsPrec :: Int -> StopBuildBatchResponse -> ShowS
$cshowsPrec :: Int -> StopBuildBatchResponse -> ShowS
Prelude.Show, (forall x. StopBuildBatchResponse -> Rep StopBuildBatchResponse x)
-> (forall x.
Rep StopBuildBatchResponse x -> StopBuildBatchResponse)
-> Generic StopBuildBatchResponse
forall x. Rep StopBuildBatchResponse x -> StopBuildBatchResponse
forall x. StopBuildBatchResponse -> Rep StopBuildBatchResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopBuildBatchResponse x -> StopBuildBatchResponse
$cfrom :: forall x. StopBuildBatchResponse -> Rep StopBuildBatchResponse x
Prelude.Generic)
newStopBuildBatchResponse ::
Prelude.Int ->
StopBuildBatchResponse
newStopBuildBatchResponse :: Int -> StopBuildBatchResponse
newStopBuildBatchResponse Int
pHttpStatus_ =
StopBuildBatchResponse' :: Maybe BuildBatch -> Int -> StopBuildBatchResponse
StopBuildBatchResponse'
{ $sel:buildBatch:StopBuildBatchResponse' :: Maybe BuildBatch
buildBatch =
Maybe BuildBatch
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopBuildBatchResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopBuildBatchResponse_buildBatch :: Lens.Lens' StopBuildBatchResponse (Prelude.Maybe BuildBatch)
stopBuildBatchResponse_buildBatch :: (Maybe BuildBatch -> f (Maybe BuildBatch))
-> StopBuildBatchResponse -> f StopBuildBatchResponse
stopBuildBatchResponse_buildBatch = (StopBuildBatchResponse -> Maybe BuildBatch)
-> (StopBuildBatchResponse
-> Maybe BuildBatch -> StopBuildBatchResponse)
-> Lens
StopBuildBatchResponse
StopBuildBatchResponse
(Maybe BuildBatch)
(Maybe BuildBatch)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopBuildBatchResponse' {Maybe BuildBatch
buildBatch :: Maybe BuildBatch
$sel:buildBatch:StopBuildBatchResponse' :: StopBuildBatchResponse -> Maybe BuildBatch
buildBatch} -> Maybe BuildBatch
buildBatch) (\s :: StopBuildBatchResponse
s@StopBuildBatchResponse' {} Maybe BuildBatch
a -> StopBuildBatchResponse
s {$sel:buildBatch:StopBuildBatchResponse' :: Maybe BuildBatch
buildBatch = Maybe BuildBatch
a} :: StopBuildBatchResponse)
stopBuildBatchResponse_httpStatus :: Lens.Lens' StopBuildBatchResponse Prelude.Int
stopBuildBatchResponse_httpStatus :: (Int -> f Int)
-> StopBuildBatchResponse -> f StopBuildBatchResponse
stopBuildBatchResponse_httpStatus = (StopBuildBatchResponse -> Int)
-> (StopBuildBatchResponse -> Int -> StopBuildBatchResponse)
-> Lens StopBuildBatchResponse StopBuildBatchResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopBuildBatchResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopBuildBatchResponse' :: StopBuildBatchResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopBuildBatchResponse
s@StopBuildBatchResponse' {} Int
a -> StopBuildBatchResponse
s {$sel:httpStatus:StopBuildBatchResponse' :: Int
httpStatus = Int
a} :: StopBuildBatchResponse)
instance Prelude.NFData StopBuildBatchResponse