{-# 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.DataPipeline.DescribePipelines
(
DescribePipelines (..),
newDescribePipelines,
describePipelines_pipelineIds,
DescribePipelinesResponse (..),
newDescribePipelinesResponse,
describePipelinesResponse_httpStatus,
describePipelinesResponse_pipelineDescriptionList,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DataPipeline.Types
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 DescribePipelines = DescribePipelines'
{
DescribePipelines -> [Text]
pipelineIds :: [Prelude.Text]
}
deriving (DescribePipelines -> DescribePipelines -> Bool
(DescribePipelines -> DescribePipelines -> Bool)
-> (DescribePipelines -> DescribePipelines -> Bool)
-> Eq DescribePipelines
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePipelines -> DescribePipelines -> Bool
$c/= :: DescribePipelines -> DescribePipelines -> Bool
== :: DescribePipelines -> DescribePipelines -> Bool
$c== :: DescribePipelines -> DescribePipelines -> Bool
Prelude.Eq, ReadPrec [DescribePipelines]
ReadPrec DescribePipelines
Int -> ReadS DescribePipelines
ReadS [DescribePipelines]
(Int -> ReadS DescribePipelines)
-> ReadS [DescribePipelines]
-> ReadPrec DescribePipelines
-> ReadPrec [DescribePipelines]
-> Read DescribePipelines
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePipelines]
$creadListPrec :: ReadPrec [DescribePipelines]
readPrec :: ReadPrec DescribePipelines
$creadPrec :: ReadPrec DescribePipelines
readList :: ReadS [DescribePipelines]
$creadList :: ReadS [DescribePipelines]
readsPrec :: Int -> ReadS DescribePipelines
$creadsPrec :: Int -> ReadS DescribePipelines
Prelude.Read, Int -> DescribePipelines -> ShowS
[DescribePipelines] -> ShowS
DescribePipelines -> String
(Int -> DescribePipelines -> ShowS)
-> (DescribePipelines -> String)
-> ([DescribePipelines] -> ShowS)
-> Show DescribePipelines
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePipelines] -> ShowS
$cshowList :: [DescribePipelines] -> ShowS
show :: DescribePipelines -> String
$cshow :: DescribePipelines -> String
showsPrec :: Int -> DescribePipelines -> ShowS
$cshowsPrec :: Int -> DescribePipelines -> ShowS
Prelude.Show, (forall x. DescribePipelines -> Rep DescribePipelines x)
-> (forall x. Rep DescribePipelines x -> DescribePipelines)
-> Generic DescribePipelines
forall x. Rep DescribePipelines x -> DescribePipelines
forall x. DescribePipelines -> Rep DescribePipelines x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePipelines x -> DescribePipelines
$cfrom :: forall x. DescribePipelines -> Rep DescribePipelines x
Prelude.Generic)
newDescribePipelines ::
DescribePipelines
newDescribePipelines :: DescribePipelines
newDescribePipelines =
DescribePipelines' :: [Text] -> DescribePipelines
DescribePipelines' {$sel:pipelineIds:DescribePipelines' :: [Text]
pipelineIds = [Text]
forall a. Monoid a => a
Prelude.mempty}
describePipelines_pipelineIds :: Lens.Lens' DescribePipelines [Prelude.Text]
describePipelines_pipelineIds :: ([Text] -> f [Text]) -> DescribePipelines -> f DescribePipelines
describePipelines_pipelineIds = (DescribePipelines -> [Text])
-> (DescribePipelines -> [Text] -> DescribePipelines)
-> Lens DescribePipelines DescribePipelines [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePipelines' {[Text]
pipelineIds :: [Text]
$sel:pipelineIds:DescribePipelines' :: DescribePipelines -> [Text]
pipelineIds} -> [Text]
pipelineIds) (\s :: DescribePipelines
s@DescribePipelines' {} [Text]
a -> DescribePipelines
s {$sel:pipelineIds:DescribePipelines' :: [Text]
pipelineIds = [Text]
a} :: DescribePipelines) (([Text] -> f [Text]) -> DescribePipelines -> f DescribePipelines)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribePipelines
-> f DescribePipelines
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DescribePipelines where
type
AWSResponse DescribePipelines =
DescribePipelinesResponse
request :: DescribePipelines -> Request DescribePipelines
request = Service -> DescribePipelines -> Request DescribePipelines
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribePipelines
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribePipelines)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribePipelines))
-> Logger
-> Service
-> Proxy DescribePipelines
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribePipelines)))
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 ->
Int -> [PipelineDescription] -> DescribePipelinesResponse
DescribePipelinesResponse'
(Int -> [PipelineDescription] -> DescribePipelinesResponse)
-> Either String Int
-> Either
String ([PipelineDescription] -> DescribePipelinesResponse)
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))
Either String ([PipelineDescription] -> DescribePipelinesResponse)
-> Either String [PipelineDescription]
-> Either String DescribePipelinesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [PipelineDescription])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"pipelineDescriptionList"
Either String (Maybe [PipelineDescription])
-> [PipelineDescription] -> Either String [PipelineDescription]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [PipelineDescription]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable DescribePipelines
instance Prelude.NFData DescribePipelines
instance Core.ToHeaders DescribePipelines where
toHeaders :: DescribePipelines -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribePipelines -> 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
"DataPipeline.DescribePipelines" ::
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 DescribePipelines where
toJSON :: DescribePipelines -> Value
toJSON DescribePipelines' {[Text]
pipelineIds :: [Text]
$sel:pipelineIds:DescribePipelines' :: DescribePipelines -> [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
"pipelineIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
pipelineIds)]
)
instance Core.ToPath DescribePipelines where
toPath :: DescribePipelines -> ByteString
toPath = ByteString -> DescribePipelines -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribePipelines where
toQuery :: DescribePipelines -> QueryString
toQuery = QueryString -> DescribePipelines -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribePipelinesResponse = DescribePipelinesResponse'
{
DescribePipelinesResponse -> Int
httpStatus :: Prelude.Int,
DescribePipelinesResponse -> [PipelineDescription]
pipelineDescriptionList :: [PipelineDescription]
}
deriving (DescribePipelinesResponse -> DescribePipelinesResponse -> Bool
(DescribePipelinesResponse -> DescribePipelinesResponse -> Bool)
-> (DescribePipelinesResponse -> DescribePipelinesResponse -> Bool)
-> Eq DescribePipelinesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePipelinesResponse -> DescribePipelinesResponse -> Bool
$c/= :: DescribePipelinesResponse -> DescribePipelinesResponse -> Bool
== :: DescribePipelinesResponse -> DescribePipelinesResponse -> Bool
$c== :: DescribePipelinesResponse -> DescribePipelinesResponse -> Bool
Prelude.Eq, ReadPrec [DescribePipelinesResponse]
ReadPrec DescribePipelinesResponse
Int -> ReadS DescribePipelinesResponse
ReadS [DescribePipelinesResponse]
(Int -> ReadS DescribePipelinesResponse)
-> ReadS [DescribePipelinesResponse]
-> ReadPrec DescribePipelinesResponse
-> ReadPrec [DescribePipelinesResponse]
-> Read DescribePipelinesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePipelinesResponse]
$creadListPrec :: ReadPrec [DescribePipelinesResponse]
readPrec :: ReadPrec DescribePipelinesResponse
$creadPrec :: ReadPrec DescribePipelinesResponse
readList :: ReadS [DescribePipelinesResponse]
$creadList :: ReadS [DescribePipelinesResponse]
readsPrec :: Int -> ReadS DescribePipelinesResponse
$creadsPrec :: Int -> ReadS DescribePipelinesResponse
Prelude.Read, Int -> DescribePipelinesResponse -> ShowS
[DescribePipelinesResponse] -> ShowS
DescribePipelinesResponse -> String
(Int -> DescribePipelinesResponse -> ShowS)
-> (DescribePipelinesResponse -> String)
-> ([DescribePipelinesResponse] -> ShowS)
-> Show DescribePipelinesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePipelinesResponse] -> ShowS
$cshowList :: [DescribePipelinesResponse] -> ShowS
show :: DescribePipelinesResponse -> String
$cshow :: DescribePipelinesResponse -> String
showsPrec :: Int -> DescribePipelinesResponse -> ShowS
$cshowsPrec :: Int -> DescribePipelinesResponse -> ShowS
Prelude.Show, (forall x.
DescribePipelinesResponse -> Rep DescribePipelinesResponse x)
-> (forall x.
Rep DescribePipelinesResponse x -> DescribePipelinesResponse)
-> Generic DescribePipelinesResponse
forall x.
Rep DescribePipelinesResponse x -> DescribePipelinesResponse
forall x.
DescribePipelinesResponse -> Rep DescribePipelinesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribePipelinesResponse x -> DescribePipelinesResponse
$cfrom :: forall x.
DescribePipelinesResponse -> Rep DescribePipelinesResponse x
Prelude.Generic)
newDescribePipelinesResponse ::
Prelude.Int ->
DescribePipelinesResponse
newDescribePipelinesResponse :: Int -> DescribePipelinesResponse
newDescribePipelinesResponse Int
pHttpStatus_ =
DescribePipelinesResponse' :: Int -> [PipelineDescription] -> DescribePipelinesResponse
DescribePipelinesResponse'
{ $sel:httpStatus:DescribePipelinesResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:pipelineDescriptionList:DescribePipelinesResponse' :: [PipelineDescription]
pipelineDescriptionList = [PipelineDescription]
forall a. Monoid a => a
Prelude.mempty
}
describePipelinesResponse_httpStatus :: Lens.Lens' DescribePipelinesResponse Prelude.Int
describePipelinesResponse_httpStatus :: (Int -> f Int)
-> DescribePipelinesResponse -> f DescribePipelinesResponse
describePipelinesResponse_httpStatus = (DescribePipelinesResponse -> Int)
-> (DescribePipelinesResponse -> Int -> DescribePipelinesResponse)
-> Lens DescribePipelinesResponse DescribePipelinesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePipelinesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribePipelinesResponse' :: DescribePipelinesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribePipelinesResponse
s@DescribePipelinesResponse' {} Int
a -> DescribePipelinesResponse
s {$sel:httpStatus:DescribePipelinesResponse' :: Int
httpStatus = Int
a} :: DescribePipelinesResponse)
describePipelinesResponse_pipelineDescriptionList :: Lens.Lens' DescribePipelinesResponse [PipelineDescription]
describePipelinesResponse_pipelineDescriptionList :: ([PipelineDescription] -> f [PipelineDescription])
-> DescribePipelinesResponse -> f DescribePipelinesResponse
describePipelinesResponse_pipelineDescriptionList = (DescribePipelinesResponse -> [PipelineDescription])
-> (DescribePipelinesResponse
-> [PipelineDescription] -> DescribePipelinesResponse)
-> Lens
DescribePipelinesResponse
DescribePipelinesResponse
[PipelineDescription]
[PipelineDescription]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePipelinesResponse' {[PipelineDescription]
pipelineDescriptionList :: [PipelineDescription]
$sel:pipelineDescriptionList:DescribePipelinesResponse' :: DescribePipelinesResponse -> [PipelineDescription]
pipelineDescriptionList} -> [PipelineDescription]
pipelineDescriptionList) (\s :: DescribePipelinesResponse
s@DescribePipelinesResponse' {} [PipelineDescription]
a -> DescribePipelinesResponse
s {$sel:pipelineDescriptionList:DescribePipelinesResponse' :: [PipelineDescription]
pipelineDescriptionList = [PipelineDescription]
a} :: DescribePipelinesResponse) (([PipelineDescription] -> f [PipelineDescription])
-> DescribePipelinesResponse -> f DescribePipelinesResponse)
-> (([PipelineDescription] -> f [PipelineDescription])
-> [PipelineDescription] -> f [PipelineDescription])
-> ([PipelineDescription] -> f [PipelineDescription])
-> DescribePipelinesResponse
-> f DescribePipelinesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PipelineDescription] -> f [PipelineDescription])
-> [PipelineDescription] -> f [PipelineDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData DescribePipelinesResponse