{-# 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.BatchGetBuildBatches
(
BatchGetBuildBatches (..),
newBatchGetBuildBatches,
batchGetBuildBatches_ids,
BatchGetBuildBatchesResponse (..),
newBatchGetBuildBatchesResponse,
batchGetBuildBatchesResponse_buildBatches,
batchGetBuildBatchesResponse_buildBatchesNotFound,
batchGetBuildBatchesResponse_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 BatchGetBuildBatches = BatchGetBuildBatches'
{
BatchGetBuildBatches -> [Text]
ids :: [Prelude.Text]
}
deriving (BatchGetBuildBatches -> BatchGetBuildBatches -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetBuildBatches -> BatchGetBuildBatches -> Bool
$c/= :: BatchGetBuildBatches -> BatchGetBuildBatches -> Bool
== :: BatchGetBuildBatches -> BatchGetBuildBatches -> Bool
$c== :: BatchGetBuildBatches -> BatchGetBuildBatches -> Bool
Prelude.Eq, ReadPrec [BatchGetBuildBatches]
ReadPrec BatchGetBuildBatches
Int -> ReadS BatchGetBuildBatches
ReadS [BatchGetBuildBatches]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetBuildBatches]
$creadListPrec :: ReadPrec [BatchGetBuildBatches]
readPrec :: ReadPrec BatchGetBuildBatches
$creadPrec :: ReadPrec BatchGetBuildBatches
readList :: ReadS [BatchGetBuildBatches]
$creadList :: ReadS [BatchGetBuildBatches]
readsPrec :: Int -> ReadS BatchGetBuildBatches
$creadsPrec :: Int -> ReadS BatchGetBuildBatches
Prelude.Read, Int -> BatchGetBuildBatches -> ShowS
[BatchGetBuildBatches] -> ShowS
BatchGetBuildBatches -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetBuildBatches] -> ShowS
$cshowList :: [BatchGetBuildBatches] -> ShowS
show :: BatchGetBuildBatches -> String
$cshow :: BatchGetBuildBatches -> String
showsPrec :: Int -> BatchGetBuildBatches -> ShowS
$cshowsPrec :: Int -> BatchGetBuildBatches -> ShowS
Prelude.Show, forall x. Rep BatchGetBuildBatches x -> BatchGetBuildBatches
forall x. BatchGetBuildBatches -> Rep BatchGetBuildBatches x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetBuildBatches x -> BatchGetBuildBatches
$cfrom :: forall x. BatchGetBuildBatches -> Rep BatchGetBuildBatches x
Prelude.Generic)
newBatchGetBuildBatches ::
BatchGetBuildBatches
newBatchGetBuildBatches :: BatchGetBuildBatches
newBatchGetBuildBatches =
BatchGetBuildBatches' {$sel:ids:BatchGetBuildBatches' :: [Text]
ids = forall a. Monoid a => a
Prelude.mempty}
batchGetBuildBatches_ids :: Lens.Lens' BatchGetBuildBatches [Prelude.Text]
batchGetBuildBatches_ids :: Lens' BatchGetBuildBatches [Text]
batchGetBuildBatches_ids = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetBuildBatches' {[Text]
ids :: [Text]
$sel:ids:BatchGetBuildBatches' :: BatchGetBuildBatches -> [Text]
ids} -> [Text]
ids) (\s :: BatchGetBuildBatches
s@BatchGetBuildBatches' {} [Text]
a -> BatchGetBuildBatches
s {$sel:ids:BatchGetBuildBatches' :: [Text]
ids = [Text]
a} :: BatchGetBuildBatches) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest BatchGetBuildBatches where
type
AWSResponse BatchGetBuildBatches =
BatchGetBuildBatchesResponse
request :: (Service -> Service)
-> BatchGetBuildBatches -> Request BatchGetBuildBatches
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 BatchGetBuildBatches
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchGetBuildBatches)))
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]
-> Maybe [Text] -> Int -> BatchGetBuildBatchesResponse
BatchGetBuildBatchesResponse'
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
"buildBatches" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"buildBatchesNotFound"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
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 BatchGetBuildBatches where
hashWithSalt :: Int -> BatchGetBuildBatches -> Int
hashWithSalt Int
_salt BatchGetBuildBatches' {[Text]
ids :: [Text]
$sel:ids:BatchGetBuildBatches' :: BatchGetBuildBatches -> [Text]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
ids
instance Prelude.NFData BatchGetBuildBatches where
rnf :: BatchGetBuildBatches -> ()
rnf BatchGetBuildBatches' {[Text]
ids :: [Text]
$sel:ids:BatchGetBuildBatches' :: BatchGetBuildBatches -> [Text]
..} = forall a. NFData a => a -> ()
Prelude.rnf [Text]
ids
instance Data.ToHeaders BatchGetBuildBatches where
toHeaders :: BatchGetBuildBatches -> 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.BatchGetBuildBatches" ::
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 BatchGetBuildBatches where
toJSON :: BatchGetBuildBatches -> Value
toJSON BatchGetBuildBatches' {[Text]
ids :: [Text]
$sel:ids:BatchGetBuildBatches' :: BatchGetBuildBatches -> [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"ids" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
ids)]
)
instance Data.ToPath BatchGetBuildBatches where
toPath :: BatchGetBuildBatches -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery BatchGetBuildBatches where
toQuery :: BatchGetBuildBatches -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data BatchGetBuildBatchesResponse = BatchGetBuildBatchesResponse'
{
BatchGetBuildBatchesResponse -> Maybe [BuildBatch]
buildBatches :: Prelude.Maybe [BuildBatch],
BatchGetBuildBatchesResponse -> Maybe [Text]
buildBatchesNotFound :: Prelude.Maybe [Prelude.Text],
BatchGetBuildBatchesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (BatchGetBuildBatchesResponse
-> BatchGetBuildBatchesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetBuildBatchesResponse
-> BatchGetBuildBatchesResponse -> Bool
$c/= :: BatchGetBuildBatchesResponse
-> BatchGetBuildBatchesResponse -> Bool
== :: BatchGetBuildBatchesResponse
-> BatchGetBuildBatchesResponse -> Bool
$c== :: BatchGetBuildBatchesResponse
-> BatchGetBuildBatchesResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetBuildBatchesResponse]
ReadPrec BatchGetBuildBatchesResponse
Int -> ReadS BatchGetBuildBatchesResponse
ReadS [BatchGetBuildBatchesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetBuildBatchesResponse]
$creadListPrec :: ReadPrec [BatchGetBuildBatchesResponse]
readPrec :: ReadPrec BatchGetBuildBatchesResponse
$creadPrec :: ReadPrec BatchGetBuildBatchesResponse
readList :: ReadS [BatchGetBuildBatchesResponse]
$creadList :: ReadS [BatchGetBuildBatchesResponse]
readsPrec :: Int -> ReadS BatchGetBuildBatchesResponse
$creadsPrec :: Int -> ReadS BatchGetBuildBatchesResponse
Prelude.Read, Int -> BatchGetBuildBatchesResponse -> ShowS
[BatchGetBuildBatchesResponse] -> ShowS
BatchGetBuildBatchesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetBuildBatchesResponse] -> ShowS
$cshowList :: [BatchGetBuildBatchesResponse] -> ShowS
show :: BatchGetBuildBatchesResponse -> String
$cshow :: BatchGetBuildBatchesResponse -> String
showsPrec :: Int -> BatchGetBuildBatchesResponse -> ShowS
$cshowsPrec :: Int -> BatchGetBuildBatchesResponse -> ShowS
Prelude.Show, forall x.
Rep BatchGetBuildBatchesResponse x -> BatchGetBuildBatchesResponse
forall x.
BatchGetBuildBatchesResponse -> Rep BatchGetBuildBatchesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetBuildBatchesResponse x -> BatchGetBuildBatchesResponse
$cfrom :: forall x.
BatchGetBuildBatchesResponse -> Rep BatchGetBuildBatchesResponse x
Prelude.Generic)
newBatchGetBuildBatchesResponse ::
Prelude.Int ->
BatchGetBuildBatchesResponse
newBatchGetBuildBatchesResponse :: Int -> BatchGetBuildBatchesResponse
newBatchGetBuildBatchesResponse Int
pHttpStatus_ =
BatchGetBuildBatchesResponse'
{ $sel:buildBatches:BatchGetBuildBatchesResponse' :: Maybe [BuildBatch]
buildBatches =
forall a. Maybe a
Prelude.Nothing,
$sel:buildBatchesNotFound:BatchGetBuildBatchesResponse' :: Maybe [Text]
buildBatchesNotFound = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:BatchGetBuildBatchesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
batchGetBuildBatchesResponse_buildBatches :: Lens.Lens' BatchGetBuildBatchesResponse (Prelude.Maybe [BuildBatch])
batchGetBuildBatchesResponse_buildBatches :: Lens' BatchGetBuildBatchesResponse (Maybe [BuildBatch])
batchGetBuildBatchesResponse_buildBatches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetBuildBatchesResponse' {Maybe [BuildBatch]
buildBatches :: Maybe [BuildBatch]
$sel:buildBatches:BatchGetBuildBatchesResponse' :: BatchGetBuildBatchesResponse -> Maybe [BuildBatch]
buildBatches} -> Maybe [BuildBatch]
buildBatches) (\s :: BatchGetBuildBatchesResponse
s@BatchGetBuildBatchesResponse' {} Maybe [BuildBatch]
a -> BatchGetBuildBatchesResponse
s {$sel:buildBatches:BatchGetBuildBatchesResponse' :: Maybe [BuildBatch]
buildBatches = Maybe [BuildBatch]
a} :: BatchGetBuildBatchesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchGetBuildBatchesResponse_buildBatchesNotFound :: Lens.Lens' BatchGetBuildBatchesResponse (Prelude.Maybe [Prelude.Text])
batchGetBuildBatchesResponse_buildBatchesNotFound :: Lens' BatchGetBuildBatchesResponse (Maybe [Text])
batchGetBuildBatchesResponse_buildBatchesNotFound = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetBuildBatchesResponse' {Maybe [Text]
buildBatchesNotFound :: Maybe [Text]
$sel:buildBatchesNotFound:BatchGetBuildBatchesResponse' :: BatchGetBuildBatchesResponse -> Maybe [Text]
buildBatchesNotFound} -> Maybe [Text]
buildBatchesNotFound) (\s :: BatchGetBuildBatchesResponse
s@BatchGetBuildBatchesResponse' {} Maybe [Text]
a -> BatchGetBuildBatchesResponse
s {$sel:buildBatchesNotFound:BatchGetBuildBatchesResponse' :: Maybe [Text]
buildBatchesNotFound = Maybe [Text]
a} :: BatchGetBuildBatchesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchGetBuildBatchesResponse_httpStatus :: Lens.Lens' BatchGetBuildBatchesResponse Prelude.Int
batchGetBuildBatchesResponse_httpStatus :: Lens' BatchGetBuildBatchesResponse Int
batchGetBuildBatchesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetBuildBatchesResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchGetBuildBatchesResponse' :: BatchGetBuildBatchesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchGetBuildBatchesResponse
s@BatchGetBuildBatchesResponse' {} Int
a -> BatchGetBuildBatchesResponse
s {$sel:httpStatus:BatchGetBuildBatchesResponse' :: Int
httpStatus = Int
a} :: BatchGetBuildBatchesResponse)
instance Prelude.NFData BatchGetBuildBatchesResponse where
rnf :: BatchGetBuildBatchesResponse -> ()
rnf BatchGetBuildBatchesResponse' {Int
Maybe [Text]
Maybe [BuildBatch]
httpStatus :: Int
buildBatchesNotFound :: Maybe [Text]
buildBatches :: Maybe [BuildBatch]
$sel:httpStatus:BatchGetBuildBatchesResponse' :: BatchGetBuildBatchesResponse -> Int
$sel:buildBatchesNotFound:BatchGetBuildBatchesResponse' :: BatchGetBuildBatchesResponse -> Maybe [Text]
$sel:buildBatches:BatchGetBuildBatchesResponse' :: BatchGetBuildBatchesResponse -> Maybe [BuildBatch]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [BuildBatch]
buildBatches
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
buildBatchesNotFound
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus