{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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' {$sel:id:StopBuildBatch' :: Text
id = Text
pId_}
stopBuildBatch_id :: Lens.Lens' StopBuildBatch Prelude.Text
stopBuildBatch_id :: Lens' StopBuildBatch Text
stopBuildBatch_id = 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 :: (Service -> Service) -> StopBuildBatch -> Request StopBuildBatch
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StopBuildBatch
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopBuildBatch)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe BuildBatch -> Int -> StopBuildBatchResponse
StopBuildBatchResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"buildBatch")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StopBuildBatch where
hashWithSalt :: Int -> StopBuildBatch -> Int
hashWithSalt Int
_salt StopBuildBatch' {Text
id :: Text
$sel:id:StopBuildBatch' :: StopBuildBatch -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData StopBuildBatch where
rnf :: StopBuildBatch -> ()
rnf StopBuildBatch' {Text
id :: Text
$sel:id:StopBuildBatch' :: StopBuildBatch -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders StopBuildBatch where
toHeaders :: StopBuildBatch -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"CodeBuild_20161006.StopBuildBatch" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StopBuildBatch where
toJSON :: StopBuildBatch -> Value
toJSON StopBuildBatch' {Text
id :: Text
$sel:id:StopBuildBatch' :: StopBuildBatch -> Text
..} =
[Pair] -> Value
Data.object
(forall a. [Maybe a] -> [a]
Prelude.catMaybes [forall a. a -> Maybe a
Prelude.Just (Key
"id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id)])
instance Data.ToPath StopBuildBatch where
toPath :: StopBuildBatch -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopBuildBatch where
toQuery :: StopBuildBatch -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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. 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'
{ $sel:buildBatch:StopBuildBatchResponse' :: Maybe BuildBatch
buildBatch =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopBuildBatchResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopBuildBatchResponse_buildBatch :: Lens.Lens' StopBuildBatchResponse (Prelude.Maybe BuildBatch)
stopBuildBatchResponse_buildBatch :: Lens' StopBuildBatchResponse (Maybe BuildBatch)
stopBuildBatchResponse_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 :: Lens' StopBuildBatchResponse Int
stopBuildBatchResponse_httpStatus = 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 where
rnf :: StopBuildBatchResponse -> ()
rnf StopBuildBatchResponse' {Int
Maybe BuildBatch
httpStatus :: Int
buildBatch :: Maybe BuildBatch
$sel:httpStatus:StopBuildBatchResponse' :: StopBuildBatchResponse -> Int
$sel:buildBatch:StopBuildBatchResponse' :: StopBuildBatchResponse -> Maybe BuildBatch
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe BuildBatch
buildBatch
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus